mcp-context-forge
mcp-context-forge copied to clipboard
Rename Toggle Endpoint to State for Clear and Explicit Status Updates
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}/toggleis renamed toPOST /servers/{server_id}/state, with corresponding updates to the handler function name and docstrings inmcpgateway/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|falseinstead of/toggle?activate=true|falsefor 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}/toggletoPOST /grpc/{id}/statein both the changelog and usage documentation. [1] [2]
Test and Example Code Updates:
- Example code and docstring tests in
mcpgateway/admin.pyare 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.