Skip to content

fix: MCP 工具统一错误边界 / MCP tool error boundary - #1222

Open
mfurkanakinci wants to merge 16 commits into
sansan0:masterfrom
mfurkanakinci:fix/mcp-tool-error-boundary
Open

mfurkanakinci wants to merge 16 commits into
sansan0:masterfrom
mfurkanakinci:fix/mcp-tool-error-boundary

Conversation

@mfurkanakinci

Copy link
Copy Markdown

中文

MCP 工具各自处理异常。平台配置读失败时会返回空列表,校验因此放行所有平台。通知配置读失败则被 except: pass 吞掉。SQLite 打不开时也只打印警告并返回空数据。

  • 增加 tool_boundary:MCPError 转成结构化错误,其他异常记录日志后返回 INTERNAL_ERROR
  • 查询、搜索和系统工具统一使用这个边界
  • 平台配置无法读取时返回 None,validate_platforms 抛出 ConfigurationError,不再静默放行
  • 通知批次配置只捕获预期的读取错误,并写入警告日志
  • SQLite 打开或读取失败时抛出 FileParseError,不再当成没有数据

English

Each MCP tool handled exceptions on its own. A failed platform-config read returned an empty list, so validation then allowed every platform. Notification config failures were swallowed with except: pass. A SQLite open failure was printed and reported as empty data.

  • Add tool_boundary. MCPError becomes a structured error. Any other exception is logged and returned as INTERNAL_ERROR
  • Query, search, and system tools share that boundary
  • An unreadable platform config returns None, and validate_platforms raises ConfigurationError instead of allowing every platform
  • Notification batch settings catch only expected read errors and log a warning
  • A SQLite open or read failure raises FileParseError instead of looking like missing data

- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常
- Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged
- 平台配置无法读取时返回配置错误,不再静默放行
- An unreadable platform config returns a configuration error instead of allowing every platform

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant