You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/elicitation/elicitation.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,7 +198,7 @@ var result = await server.ElicitAsync(new ElicitRequestParams
198
198
199
199
#### Low-level API
200
200
201
-
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.IncompleteResultException> with an elicitation input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
201
+
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.InputRequiredException> with an elicitation input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
202
202
203
203
```csharp
204
204
[McpServerTool, Description("Tool that elicits via low-level MRTR")]
@@ -221,7 +221,7 @@ public static string ElicitWithMrtr(
Copy file name to clipboardExpand all lines: docs/concepts/mrtr/mrtr.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,10 @@ MRTR is useful when:
26
26
## How MRTR works
27
27
28
28
1. The client calls a tool on the server via `tools/call`.
29
-
2. The server tool determines it needs client input and returns an `IncompleteResult` containing `inputRequests` and/or `requestState`.
29
+
2. The server tool determines it needs client input and returns an `InputRequiredResult` containing `inputRequests` and/or `requestState`.
30
30
3. The client resolves each input request (e.g., prompts the user for elicitation, calls an LLM for sampling).
31
31
4. The client retries the original `tools/call` with `inputResponses` (keyed to the input requests) and `requestState` echoed back.
32
-
5. The server processes the responses and either returns a final result or another `IncompleteResult` for additional rounds.
32
+
5. The server processes the responses and either returns a final result or another `InputRequiredResult` for additional rounds.
33
33
34
34
## Opting in
35
35
@@ -130,7 +130,7 @@ public static string MyTool(
130
130
131
131
### Returning an incomplete result
132
132
133
-
Throw <xref:ModelContextProtocol.Protocol.IncompleteResultException> to return an incomplete result to the client. The exception carries an <xref:ModelContextProtocol.Protocol.IncompleteResult> containing `inputRequests` and/or `requestState`:
133
+
Throw <xref:ModelContextProtocol.Protocol.InputRequiredException> to return an incomplete result to the client. The exception carries an <xref:ModelContextProtocol.Protocol.InputRequiredResult> containing `inputRequests` and/or `requestState`:
134
134
135
135
```csharp
136
136
[McpServerTool, Description("Stateless tool managing its own MRTR flow")]
@@ -155,7 +155,7 @@ public static string StatelessTool(
@@ -332,7 +332,7 @@ When a server has MRTR enabled but the connected client does not:
332
332
333
333
### Backward compatibility for MRTR-native tools
334
334
335
-
Tools written with the low-level MRTR pattern (`IncompleteResultException`) work automatically with clients that don't support MRTR. When a tool throws `IncompleteResultException` and the client hasn't negotiated MRTR, the SDK resolves each `InputRequest` by sending the corresponding standard JSON-RPC call (elicitation, sampling, or roots) to the client, then retries the handler with the resolved responses.
335
+
Tools written with the low-level MRTR pattern (`InputRequiredException`) work automatically with clients that don't support MRTR. When a tool throws `InputRequiredException` and the client hasn't negotiated MRTR, the SDK resolves each `InputRequest` by sending the corresponding standard JSON-RPC call (elicitation, sampling, or roots) to the client, then retries the handler with the resolved responses.
336
336
337
337
This means you can write a single tool implementation using the MRTR-native pattern and it will work with any client:
338
338
@@ -350,7 +350,7 @@ public static string GetWeather(
@@ -363,8 +363,8 @@ public static string GetWeather(
363
363
}
364
364
```
365
365
366
-
-**With an MRTR client**: The `IncompleteResult` is sent over the wire. The client resolves the elicitation and retries with `inputResponses`.
367
-
-**Without MRTR**: The SDK sends a standard `elicitation/create` JSON-RPC request to the client, collects the response, and retries the handler internally. The client never sees the `IncompleteResult`.
366
+
-**With an MRTR client**: The `InputRequiredResult` is sent over the wire. The client resolves the elicitation and retries with `inputResponses`.
367
+
-**Without MRTR**: The SDK sends a standard `elicitation/create` JSON-RPC request to the client, collects the response, and retries the handler internally. The client never sees the `InputRequiredResult`.
368
368
369
369
> [!NOTE]
370
370
> The backcompat retry loop resolves up to 10 rounds. Tools that need more rounds should use the high-level API (`ElicitAsync`) instead.
Copy file name to clipboardExpand all lines: docs/concepts/roots/roots.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ foreach (var root in result.Roots)
123
123
124
124
#### Low-level API
125
125
126
-
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.IncompleteResultException> with a roots input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
126
+
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.InputRequiredException> with a roots input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
127
127
128
128
```csharp
129
129
[McpServerTool, Description("Tool that requests roots via low-level MRTR")]
@@ -144,7 +144,7 @@ public static string ListRootsWithMrtr(
Copy file name to clipboardExpand all lines: docs/concepts/sampling/sampling.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ var result = await server.SampleAsync(
149
149
150
150
#### Low-level API
151
151
152
-
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.IncompleteResultException> with a sampling input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
152
+
For stateless servers or scenarios requiring manual control, throw <xref:ModelContextProtocol.Protocol.InputRequiredException> with a sampling input request. On retry, read the client's response from <xref:ModelContextProtocol.Protocol.RequestParams.InputResponses>:
153
153
154
154
```csharp
155
155
[McpServerTool, Description("Tool that samples via low-level MRTR")]
@@ -171,7 +171,7 @@ public static string SampleWithMrtr(
171
171
}
172
172
173
173
// First call — request LLM completion from the client
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received legacy '{Method}' JSON-RPC request on session that negotiated MRTR. The server should use IncompleteResult instead of sending direct requests.")]
849
+
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received legacy '{Method}' JSON-RPC request on session that negotiated MRTR. The server should use InputRequiredResult instead of sending direct requests.")]
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received IncompleteResult for '{Method}' on session that did not negotiate MRTR (protocol version '{ProtocolVersion}'). The server may not be spec-compliant.")]
[LoggerMessage(Level=LogLevel.Warning,Message="{EndpointName} received InputRequiredResult for '{Method}' on session that did not negotiate MRTR (protocol version '{ProtocolVersion}'). The server may not be spec-compliant.")]
0 commit comments