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 摘要。