[KongchangAI]
Concept

ToolError

A dedicated exception type in MCP for handling tool execution errors. It allows the agent model to see explicit error information and return values, so that the model can recognize a failed tool call rather than repeating it without purpose.

Timeline (last 90 days)

Oct 12

When throwing exceptions in MCP tools, ToolError should be used instead of ordinary ValueError, because ToolError lets the model see the explicit reason and return value, whereas ordinary exceptions may cause the Agent to see only 'tool execution failed' or even trigger meaningless automatic retries.

Unverified50%
Oct 12

Write a tool once in an MCP Server, and the Agent can connect via stdio or streamable HTTP, and when errors occur, ToolError should be used first.

Unverified50%

All Facts (2)

Source Articles