Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions src/ModelContextProtocol.Core/McpErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ public enum McpErrorCode
InvalidRequest = -32600,

/// <summary>
/// Indicates that the requested method does not exist or is not available on the server.
/// Indicates that the requested method does not exist or is not available.
/// </summary>
/// <remarks>
/// This error is returned when the method name specified in the request cannot be found.
/// <para>
/// In MCP, this error is returned when a request is made for a method that requires a capability
/// that has not been declared. This can occur in either direction:
/// </para>
/// <list type="bullet">
/// <item><description>A server returning this error when the client requests a capability it doesn't support
/// (for example, requesting completions when the <c>completions</c> capability was not advertised).</description></item>
/// <item><description>A client returning this error when the server requests a capability it doesn't support
/// (for example, requesting roots when the client did not declare the <c>roots</c> capability).</description></item>
/// </list>
/// </remarks>
MethodNotFound = -32601,

Expand All @@ -51,12 +60,16 @@ public enum McpErrorCode
/// </summary>
/// <remarks>
/// <para>
/// This error is returned for protocol-level parameter issues, such as:
Comment thread
stephentoub marked this conversation as resolved.
/// In MCP, this error is returned in various contexts when request parameters fail validation:
/// </para>
/// <list type="bullet">
/// <item><description>Malformed requests that fail to satisfy the request schema (for example, CallToolRequest)</description></item>
/// <item><description>Unknown or unrecognized primitive names (for example, tool, prompt, or resource names)</description></item>
/// <item><description>Missing required protocol-level parameters</description></item>
/// <item><description><b>Tools</b>: Unknown tool name or invalid tool arguments.</description></item>
/// <item><description><b>Prompts</b>: Unknown prompt name or missing required arguments.</description></item>
/// <item><description><b>Pagination</b>: Invalid or expired cursor values.</description></item>
/// <item><description><b>Logging</b>: Invalid log level.</description></item>
/// <item><description><b>Tasks</b>: Invalid or nonexistent task ID, invalid cursor, or attempting to cancel a task already in a terminal status.</description></item>
/// <item><description><b>Elicitation</b>: Server requests an elicitation mode not declared in client capabilities.</description></item>
/// <item><description><b>Sampling</b>: Missing tool result or tool results mixed with other content.</description></item>
/// </list>
/// <para>
/// Note: Input validation errors within tool/prompt/resource arguments should be reported as execution errors
Expand Down
Loading