Namespace Nexus\Mcp\Core\Schema\Error

Classes
HeaderMismatchError

Returned when a server rejects a request because the values in the HTTP headers do not match the corresponding values in the request body, or because required headers are missing or malformed. For HTTP, the response status code MUST be 400 Bad Request.

InternalError

A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.

InvalidParamsError

A JSON-RPC error indicating that the method parameters are invalid or malformed. In MCP, this error is returned in various contexts when request parameters fail validation: - Tools: Unknown tool name or invalid tool arguments

  • Prompts: Unknown prompt name or missing required arguments
  • Pagination: Invalid or expired cursor values
  • Logging: Invalid log level
  • Elicitation: Server requests an elicitation mode not declared in client capabilities
  • Sampling: Missing tool result or tool results mixed with other content
InvalidRequestError

A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like jsonrpc or method, or using invalid types for these fields).

MethodNotFoundError

A JSON-RPC error indicating that the requested method does not exist or is not available. In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling prompts/list when the prompts capability was not advertised). A request that requires a client capability the client did not declare is signalled instead by MissingRequiredClientCapabilityError (-32021).

MissingRequiredClientCapabilityError

Returned when processing a request requires a capability the client did not declare in clientCapabilities. For HTTP, the response status code MUST be 400 Bad Request.

ParseError

A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.

UnknownProtocolError

Error carrying a raw integer code that does not map to a known ProtocolErrorCode case.

UnsupportedProtocolVersionError

Returned when the request's protocol version is unknown to the server or unsupported (e.g., a known experimental or draft version the server has chosen not to implement). For HTTP, the response status code MUST be 400 Bad Request.