mcp-context-forge icon indicating copy to clipboard operation
mcp-context-forge copied to clipboard

Rename Toggle Endpoint to State for Clear and Explicit Status Updates

Open rakdutta opened this issue 2 weeks ago • 0 comments

closes issue #https://github.com/IBM/mcp-context-forge/issues/1497 The existing /toggle endpoint caused confusion because it did not truly “toggle” the resource state. Instead, it always set the state based on the activate parameter (e.g., activate=true), leading users to assume it was flipping the current status.

To remove ambiguity and make the API behavior explicit, this PR updates the endpoint name from /toggle to /state. The new design clearly communicates that the endpoint sets the state rather than toggling it.

Key Changes

  • Renamed /toggle endpoints to /state across all relevant resources.
  • Updated documentation, examples, and UI references to align with the new terminology. -Improved clarity and consistency across servers, tools, agents, gateways, prompts, resources, and gRPC services.

API Endpoint Updates:

  • The server admin endpoint POST /servers/{server_id}/toggle is renamed to POST /servers/{server_id}/state, with corresponding updates to the handler function name and docstrings in mcpgateway/admin.py. All references to "toggle" are replaced with "set state" for clarity. [1] [2]

Documentation and Example Updates:

  • All documentation and example API calls (in README.md, docs/docs/index.md, docs/docs/manage/api-usage.md, etc.) now use /state?activate=true|false instead of /toggle?activate=true|false for setting active/inactive states of entities. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Terminology Consistency:

  • Terminology throughout the documentation, changelog, and UI guides is updated to use "Set state" or "Enable/Disable" instead of "Toggle". This applies to server, tool, agent, gateway, prompt, resource, and gRPC service activation/deactivation actions. [1] [2] [3] [4] [5] [6] [7]

gRPC Service Endpoint Update:

  • The gRPC service activation endpoint is changed from POST /grpc/{id}/toggle to POST /grpc/{id}/state in both the changelog and usage documentation. [1] [2]

Test and Example Code Updates:

  • Example code and docstring tests in mcpgateway/admin.py are updated to use the new endpoint and terminology, ensuring that both happy paths and error cases reflect the "set state" logic.

Also fixed team is coming as N/A in list resources page in admin UI.

rakdutta avatar Nov 26 '25 04:11 rakdutta