Skip to main content

Module error

Module error 

Source
Expand description

Error types for tower-mcp

§JSON-RPC Error Codes

Standard JSON-RPC 2.0 error codes are defined in the specification: https://www.jsonrpc.org/specification#error_object

CodeMessageMeaning
-32700Parse errorInvalid JSON was received
-32600Invalid RequestThe JSON sent is not a valid Request
-32601Method not foundThe method does not exist / is not available
-32602Invalid paramsInvalid method parameter(s)
-32603Internal errorInternal JSON-RPC error

§MCP-Specific Error Codes

MCP uses the server error range (-32000 to -32099) for protocol-specific errors:

CodeNameMeaning
-32000ConnectionClosedTransport connection was closed
-32001RequestTimeoutRequest exceeded timeout
-32002ResourceNotFoundResource not found
-32003AlreadySubscribedResource already subscribed
-32004NotSubscribedResource not subscribed (for unsubscribe)
-32005SessionNotFoundSession not found or expired
-32006SessionRequiredMCP-Session-Id header is required
-32007ForbiddenAccess forbidden (insufficient scope)

Structs§

JsonRpcError
JSON-RPC error object
ToolError
Tool execution error with context

Enums§

Error
tower-mcp error type
ErrorCode
Standard JSON-RPC error codes
McpErrorCode
MCP-specific error codes (in the -32000 to -32099 range)

Type Aliases§

BoxError
Type-erased error type used for middleware composition.
Result
Result type alias for tower-mcp