Skip to content

Comments

docs: add server-side tool error handling documentation#2129

Open
felixweinberger wants to merge 3 commits intov1.xfrom
fweinberger/tool-error-docs
Open

docs: add server-side tool error handling documentation#2129
felixweinberger wants to merge 3 commits intov1.xfrom
fweinberger/tool-error-docs

Conversation

@felixweinberger
Copy link
Contributor

Add an 'Error Handling' subsection to the Tools section of docs/server.md covering three approaches: raising ToolError, unhandled exception auto-conversion, and returning CallToolResult(isError=True) directly. Includes a runnable example at examples/snippets/servers/tool_errors.py.

Add an 'Error Handling' subsection to the Tools section of docs/server.md
covering three approaches: raising ToolError, unhandled exception
auto-conversion, and returning CallToolResult(isError=True) directly.
Includes a runnable example at examples/snippets/servers/tool_errors.py.
@felixweinberger felixweinberger marked this pull request as ready for review February 23, 2026 22:24
@Kludex
Copy link
Member

Kludex commented Feb 23, 2026

This seems a horrible experience in v2 btw, we should have a more "raise HTTPException" experience like Starlette offers.

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.

2 participants