Fix markdown links in docs and add docfx CI validation (#862)
* Initial plan * Replace obsolete API references with xref tags in markdown docs Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Add documentation guidelines for xref syntax Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Fix: Only update link URLs, preserve document structure Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Add --warningsAsErrors flag to docfx command in Makefile Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Add CI validation for document generation * Fix broken link * Fix invalid xref cross-references in documentation Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Apply suggestion from @eiriktsarpalis * Fix Progress link syntax and remove docs/README.md Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * Separate build & test targets * Apply suggestion from @eiriktsarpalis * tweak Makefile * Fix test results upload path * Add emojis to CI workflow step names Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> * perform manual cleanups --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
This commit is contained in:
parent
c40effebc4
commit
b40f06c043
1 changed files with 54 additions and 91 deletions
|
|
@ -11,12 +11,9 @@ The **elicitation** feature allows servers to request additional information fro
|
|||
|
||||
### Server Support for Elicitation
|
||||
|
||||
Servers request structured data from users with the [ElicitAsync] extension method on [IMcpServer].
|
||||
The C# SDK registers an instance of [IMcpServer] with the dependency injection container,
|
||||
so tools can simply add a parameter of type [IMcpServer] to their method signature to access it.
|
||||
|
||||
[ElicitAsync]: https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.Server.McpServerExtensions.html#ModelContextProtocol_Server_McpServerExtensions_ElicitAsync_ModelContextProtocol_Server_IMcpServer_ModelContextProtocol_Protocol_ElicitRequestParams_System_Threading_CancellationToken_
|
||||
[IMcpServer]: https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.Server.IMcpServer.html
|
||||
Servers request structured data from users with the <xref:ModelContextProtocol.Server.McpServer.ElicitAsync*> extension method on <xref:ModelContextProtocol.Server.McpServer>.
|
||||
The C# SDK registers an instance of <xref:ModelContextProtocol.Server.McpServer> with the dependency injection container,
|
||||
so tools can simply add a parameter of type <xref:ModelContextProtocol.Server.McpServer> to their method signature to access it.
|
||||
|
||||
The MCP Server must specify the schema of each input value it is requesting from the user.
|
||||
Only primitive types (string, number, boolean) are supported for elicitation requests.
|
||||
|
|
@ -31,10 +28,7 @@ The following example demonstrates how a server could request a boolean response
|
|||
|
||||
### Client Support for Elicitation
|
||||
|
||||
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]:
|
||||
|
||||
[ElicitationHandler]: https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.Protocol.ElicitationCapability.html#ModelContextProtocol_Protocol_ElicitationCapability_ElicitationHandler
|
||||
[McpClientOptions]: https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.Client.McpClientOptions.html
|
||||
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 <xref:ModelContextProtocol.Client.McpClientHandlers.ElicitationHandler> in the <xref:ModelContextProtocol.Client.McpClientOptions>:
|
||||
|
||||
[!code-csharp[](samples/client/Program.cs?name=snippet_McpInitialize)]
|
||||
|
||||
|
|
@ -42,10 +36,8 @@ The ElicitationHandler is an asynchronous method that will be called when the se
|
|||
The ElicitationHandler must request input from the user and return the data in a format that matches the requested schema.
|
||||
This will be highly dependent on the client application and how it interacts with the user.
|
||||
|
||||
If the user provides the requested information, the ElicitationHandler should return an [ElicitResult] with the action set to "accept" and the content containing the user's input.
|
||||
If the user does not provide the requested information, the ElicitationHandler should return an [ElicitResult] with the action set to "reject" and no content.
|
||||
|
||||
[ElicitResult]: https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.Protocol.ElicitResult.html
|
||||
If the user provides the requested information, the ElicitationHandler should return an <xref:ModelContextProtocol.Protocol.ElicitResult> with the action set to "accept" and the content containing the user's input.
|
||||
If the user does not provide the requested information, the ElicitationHandler should return an [<xref:ModelContextProtocol.Protocol.ElicitResult> with the action set to "reject" and no content.
|
||||
|
||||
Below is an example of how a console application might handle elicitation requests.
|
||||
Here's an example implementation:
|
||||
|
|
|
|||
Loading…
Reference in a new issue