Enum McpErrorCode
- Namespace
- ModelContextProtocol
- Assembly
- ModelContextProtocol.Core.dll
Represents standard JSON-RPC error codes as defined in the MCP specification.
public enum McpErrorCode
Fields
InternalError = -32603Indicates that an internal error occurred while processing the request.
This error is used when the endpoint encounters an unexpected condition that prevents it from fulfilling the request.
InvalidParams = -32602Indicates that the request parameters are invalid at the protocol level.
This error is returned for protocol-level parameter issues, such as:
- Malformed requests that fail to satisfy the request schema (for example, CallToolRequest)
- Unknown or unrecognized primitive names (for example, tool, prompt, or resource names)
- Missing required protocol-level parameters
Note: Input validation errors within tool/prompt/resource arguments should be reported as execution errors (for example, via IsError) rather than as protocol errors, allowing language models to receive error feedback and self-correct.
InvalidRequest = -32600Indicates that the JSON payload does not conform to the expected Request object structure.
The request is considered invalid if it lacks required fields or fails to follow the JSON-RPC protocol.
MethodNotFound = -32601Indicates that the requested method does not exist or is not available on the server.
This error is returned when the method name specified in the request cannot be found.
ParseError = -32700Indicates that the JSON received could not be parsed.
This error occurs when the input contains malformed JSON or incorrect syntax.
ResourceNotFound = -32002Indicates that the requested resource could not be found.
This error should be used when a resource URI does not match any available resource on the server. It allows clients to distinguish between missing resources and other types of errors.
UrlElicitationRequired = -32042Indicates that URL-mode elicitation is required to complete the requested operation.
This error is returned when a server operation requires additional user input through URL-mode elicitation before it can proceed. The error data must include the `data.elicitations` payload describing the pending elicitation(s) for the client to present to the user.
Common scenarios include OAuth authorization and other out-of-band flows that cannot be completed inside the MCP client.