Add McpClient/Session methods using .Protocol types (#1063)
This commit is contained in:
parent
d76bc16bd1
commit
4a84412331
2 changed files with 1116 additions and 639 deletions
|
|
@ -69,7 +69,7 @@ Clients should check if the server supports logging by checking the <xref:ModelC
|
|||
[!code-csharp[](samples/client/Program.cs?name=snippet_LoggingCapabilities)]
|
||||
|
||||
If the server supports logging, the client should set the level of log messages it wishes to receive with
|
||||
the <xref:ModelContextProtocol.Client.McpClient.SetLoggingLevel*> method on <xref:ModelContextProtocol.Client.McpClient>. If the client does not set a logging level, the server might choose
|
||||
the <xref:ModelContextProtocol.Client.McpClient.SetLoggingLevelAsync*> method on <xref:ModelContextProtocol.Client.McpClient>. If the client does not set a logging level, the server might choose
|
||||
to send all log messages or none—this is not specified in the protocol. So it's important that the client
|
||||
sets a logging level to ensure it receives the desired log messages and only those messages.
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ if (firstArgument is not null)
|
|||
if (Enum.TryParse<LoggingLevel>(firstArgument, true, out var loggingLevel))
|
||||
{
|
||||
// <snippet_LoggingLevel>
|
||||
await mcpClient.SetLoggingLevel(loggingLevel);
|
||||
await mcpClient.SetLoggingLevelAsync(loggingLevel);
|
||||
// </snippet_LoggingLevel>
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue