modelcontextprotocol / modelcontextprotocol/python-sdk
Specific ToolNotFoundError for easier handling than ToolError in multi-tenant environments
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.3k
- Forks
- 4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 31
Description
Description
We are running a remote MCP server and we are seeing errors like:
mcp.server.fastmcp.exceptions.ToolError: Unknown tool: <unknown-tool-name>
I'm unsure why our users are trying to call our remote MCP server with the name of a tool that we don't manage. Regardless, we would like to handle these errors separately from a generic ToolError. For instance:
ToolNotFoundError: user error that shouldn't alert us.ToolError: an error that could indicate an actual issue with our system that we should alert on and fix.
References
I couldn't find any issues related to this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with mcp.server.fastmcp.exceptions.ToolError and trace the remote server path that emits “Unknown tool.” Define what distinguishes an unknown tool from other tool failures, then verify that callers can handle the two cases separately; the issue does not name a test file, so locate the relevant exception or server tests before changing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100