modelcontextprotocol / modelcontextprotocol/python-sdk

Specific ToolNotFoundError for easier handling than ToolError in multi-tenant environments

未关闭
#2,422 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 mcp.server.fastmcp.exceptions.ToolError 开始,追踪发出“Unknown tool.”的远程服务器路径。定义未知工具与其他工具失败之间的区别,然后验证调用方能够分别处理这两种情况;该 issue 未指定测试文件,因此请先找到相关的异常或服务器测试,再更改行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。