namespace ModelContextProtocol; /// /// Represents standard JSON-RPC error codes as defined in the MCP specification. /// public enum McpErrorCode { /// /// Indicates that the JSON received could not be parsed. /// /// /// This error occurs when the input contains malformed JSON or incorrect syntax. /// ParseError = -32700, /// /// Indicates 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. /// InvalidRequest = -32600, /// /// Indicates 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. /// MethodNotFound = -32601, /// /// Indicates 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 ) rather than as protocol errors, allowing language /// models to receive error feedback and self-correct. /// /// InvalidParams = -32602, /// /// Indicates 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. /// InternalError = -32603, }