Document MCP tool filter naming across SDKs - #2101
Conversation
|
Thanks for digging into this, and for the detailed writeup in #869. The repro is clear and this is a genuinely confusing failure mode (zero tools, no error, hooks never fire). Before going further with the code change, I want to flag something that changes the right scope here: the def add_mcp(self, tool_name: str) -> ToolSet:
"""Add an MCP tool pattern (e.g. "github-list_issues" or "*")."""The same docstring/example exists in the nodejs, dotnet, java, go, and rust SDKs too ( Given that, I think the right-sized fix here is docs-only, and should probably span all the SDKs rather than just Python, since the naming convention is a backend/CLI-level thing and every language hits the same trap:
I'd rather not add the auto-alias-expansion logic in
Would you be up for narrowing this PR to the doc changes (README + docstrings) and applying the same wording across the other SDK directories? This is a good contribution, just want to make sure it lands in the most maintainable spot. |
|
Thanks, that makes sense. I agree that silently expanding bare names in Python would introduce ambiguous behavior and leave the other SDKs inconsistent. I’ve narrowed this PR to documentation, removed the normalization code and related tests, and applied consistent guidance across the SDK READMEs and the relevant The warning for unmatched tool filters still seems potentially useful, but I agree that would be better handled separately and centrally so all SDKs receive the same behavior. |
Fixes #869
This PR documents that MCP tools registered via
mcp_serversare exposed to the runtime as<server-key>-<tool-name>, and adds consistent guidance across the SDKs for how to reference those tools in session tool filters and agent configs.Changes included:
<server-key>-<tool-name>convention across the SDK READMEsavailable_tools/excluded_tools/custom_agents/default_agentdocs to explain when to usemcp:<server-key>-<tool-name>/ToolSet.addMcp()and when to use<server-key>-<tool-name>directly