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 (e.g., CallToolRequest)
- Unknown or unrecognized primitive names (e.g., 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 (e.g., 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.