Skip to content

Conversation

@rakdutta
Copy link
Collaborator

@rakdutta rakdutta commented Nov 26, 2025

closes issue ##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.

Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
@rakdutta rakdutta marked this pull request as ready for review November 26, 2025 07:08
@crivetimihai crivetimihai self-assigned this Nov 26, 2025
Copy link
Collaborator

@madhav165 madhav165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crivetimihai Please wait for my RBAC PR before merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants