Skip to content

Commit f2fd204

Browse files
authored
Fix the docs and make the more readable (#281)
1 parent f4c87f5 commit f2fd204

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To get started writing a client, the `McpClientFactory.CreateAsync` method is us
3131
to a server. Once you have an `IMcpClient`, you can interact with it, such as to enumerate all available tools and invoke tools.
3232

3333
```csharp
34-
var clientTransport = new StdioClientTransport(new()
34+
var clientTransport = new StdioClientTransport(new StdioClientTransportOptions
3535
{
3636
Name = "Everything",
3737
Command = "npx",
@@ -163,10 +163,10 @@ using System.Text.Json;
163163

164164
McpServerOptions options = new()
165165
{
166-
ServerInfo = new() { Name = "MyServer", Version = "1.0.0" },
167-
Capabilities = new()
166+
ServerInfo = new Implementation() { Name = "MyServer", Version = "1.0.0" },
167+
Capabilities = new ServerCapabilities()
168168
{
169-
Tools = new()
169+
Tools = new ToolsCapability()
170170
{
171171
ListToolsHandler = (request, cancellationToken) =>
172172
Task.FromResult(new ListToolsResult()
@@ -199,7 +199,7 @@ McpServerOptions options = new()
199199
{
200200
if (request.Params.Arguments?.TryGetValue("message", out var message) is not true)
201201
{
202-
throw new McpServerException("Missing required argument 'message'");
202+
throw new McpException("Missing required argument 'message'");
203203
}
204204

205205
return Task.FromResult(new CallToolResponse()
@@ -208,7 +208,7 @@ McpServerOptions options = new()
208208
});
209209
}
210210

211-
throw new McpServerException($"Unknown tool: '{request.Params?.Name}'");
211+
throw new McpException($"Unknown tool: '{request.Params?.Name}'");
212212
},
213213
}
214214
},

0 commit comments

Comments
 (0)