| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add MCPServer.get_tool to retrieve a registered tool by name without using the private _tool_manager, completing the add/remove CRUD surface. Fixes modelcontextprotocol#3162
| Back | FazBrowse Home | New Git URL |
Summary
Adds a public MCPServer.get_tool(name) -> Tool | None that delegates to the existing ToolManager.get_tool, so callers can look up a registered tool without using the private _tool_manager.
This completes the public tool registration surface next to add_tool() / remove_tool().
Use case (from #3162): after registration, update a tool's inputSchema (e.g. attach oneOf / discriminated action schemas) via the returned tool's mutable parameters dict.
Fixes #3162
Notes on issue discussion
Maintainer asked whether customizing inputSchema at registration time would be enough. This PR still implements the issue's proposed API (get_tool) because:
Test plan
AI disclosure
Assisted by AI (Grok / Cursor) for implementation and tests; human-reviewed before submit.