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
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,11 @@ description: Enable interactive AI experiences by requesting user input during t
5
5
uid: elicitation
6
6
---
7
7
8
+
## Elicitation
9
+
8
10
The **elicitation** feature allows servers to request additional information from users during interactions. This enables more dynamic and interactive AI experiences, making it easier to gather necessary context before executing tasks.
9
11
10
-
## Server Support for Elicitation
12
+
###Server Support for Elicitation
11
13
12
14
Servers request structured data from users with the [ElicitAsync] extension method on [IMcpServer].
13
15
The C# SDK registers an instance of [IMcpServer] with the dependency injection container,
@@ -27,7 +29,7 @@ The following example demonstrates how a server could request a boolean response
Elicitation is an optional feature so clients declare their support for it in their capabilities as part of the `initialize` request. In the MCP C# SDK, this is done by configuring an [ElicitationHandler] in the [McpClientOptions]:
Typically progress tracking is supported by server tools that perform operations that take a significant amount of time to complete, such as data processing or complex calculations.
14
+
Typically progress tracking is supported by server tools that perform operations that take a significant amount of time to complete, such as image generation or complex calculations.
12
15
However, progress tracking is defined in the MCP specification as a general feature that can be implemented for any request that is handled by either a server or a client.
13
16
This project illustrates the common case of a server tool that performs a long-running operation and sends progress updates to the client.
14
17
@@ -24,7 +27,7 @@ The parameters passed to [sendNotificationAsync] should be an instance of [Progr
The server should verify that the caller provided a `progressToken` in the request and include it in the call to [sendNotificationAsync]. The following example demonstrates how a server can send a progress notification:
30
+
The server must verify that the caller provided a `progressToken` in the request and include it in the call to [sendNotificationAsync]. The following example demonstrates how a server can send a progress notification:
The second way is to pass a [Progress<T>] instance to the tool method. The MCP C# SDK will automatically handle progress notifications and report them through the [Progress<T>] instance. This notification handler will only receive progress updates for the specific request that was made, rather than all progress notifications from the server.
60
+
The second way is to pass a [Progress`<T>`] instance to the tool method. [Progress`<T>`] is a standard .NET type that provides a way to receive progress updates.
61
+
For the purposes of MCP progress notifications, `T` should be [ProgressNotificationValue].
62
+
The MCP C# SDK will automatically handle progress notifications and report them through the [Progress`<T>`] instance.
63
+
This notification handler will only receive progress updates for the specific request that was made,
64
+
rather than all progress notifications from the server.
0 commit comments