Skip to content

In an STDIO server is there any way to throw a tool error and/or a protocol error? #85

@AbhinavPalacharla

Description

@AbhinavPalacharla

From the MCP docs (https://modelcontextprotocol.io/specification/2025-06-18/server/tools#error-handling)

Protocol Error Example:

{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32602,
"message": "Unknown tool: invalid_tool_name"
}
}

Tool Error Example:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"content": [
{
"type": "text",
"text": "Failed to fetch weather data: API rate limit exceeded"
}
],
"isError": true
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions