modelcontextprotocol / modelcontextprotocol/python-sdk
Specific ToolNotFoundError for easier handling than ToolError in multi-tenant environments
未关闭
还没有人认领这个 Issue。
enhancement
needs decision
P3
- 主要语言
- Python
- 星标
- 24.3k
- 派生
- 4k
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 31
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 mcp.server.fastmcp.exceptions.ToolError 开始,追踪发出“Unknown tool.”的远程服务器路径。定义未知工具与其他工具失败之间的区别,然后验证调用方能够分别处理这两种情况;该 issue 未指定测试文件,因此请先找到相关的异常或服务器测试,再更改行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api, backend
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 50/100