Skip to content

Commit dc8feff

Browse files
Copilotstephentoub
andcommitted
Update XML docs for McpErrorCode MethodNotFound and InvalidParams
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent bcda2a5 commit dc8feff

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

src/ModelContextProtocol.Core/McpErrorCode.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ public enum McpErrorCode
3939
InvalidRequest = -32600,
4040

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

@@ -51,12 +60,16 @@ public enum McpErrorCode
5160
/// </summary>
5261
/// <remarks>
5362
/// <para>
54-
/// This error is returned for protocol-level parameter issues, such as:
63+
/// In MCP, this error is returned in various contexts when request parameters fail validation:
5564
/// </para>
5665
/// <list type="bullet">
57-
/// <item><description>Malformed requests that fail to satisfy the request schema (for example, CallToolRequest)</description></item>
58-
/// <item><description>Unknown or unrecognized primitive names (for example, tool, prompt, or resource names)</description></item>
59-
/// <item><description>Missing required protocol-level parameters</description></item>
66+
/// <item><description><b>Tools</b>: Unknown tool name or invalid tool arguments.</description></item>
67+
/// <item><description><b>Prompts</b>: Unknown prompt name or missing required arguments.</description></item>
68+
/// <item><description><b>Pagination</b>: Invalid or expired cursor values.</description></item>
69+
/// <item><description><b>Logging</b>: Invalid log level.</description></item>
70+
/// <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>
71+
/// <item><description><b>Elicitation</b>: Server requests an elicitation mode not declared in client capabilities.</description></item>
72+
/// <item><description><b>Sampling</b>: Missing tool result or tool results mixed with other content.</description></item>
6073
/// </list>
6174
/// <para>
6275
/// Note: Input validation errors within tool/prompt/resource arguments should be reported as execution errors

0 commit comments

Comments
 (0)