Replies: 2 comments 1 reply
-
|
I believe you return a CallToolResult with https://modelcontextprotocol.io/specification/2025-11-25/server/tools#error-handling |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Sorry ... should have provided more detail. Don't change the return type of your method. But you can generate a CallToolResult with if (count > 20)
{
throw new McpException("Count exceeds maximum limit of 20.");
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
What is the recommended way of handling errors in a tool that uses structured content? If I return a CallToolResult directly, the generated output schema is effectively useless, but there doesn't seem to be any other way.
Beta Was this translation helpful? Give feedback.
All reactions