Use strong-typing of params in most remaining McpClientExtensions methods (#224)
This commit is contained in:
parent
faf12b6a94
commit
03dc90aa33
2 changed files with 74 additions and 73 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol.Types;
|
||||
|
||||
|
|
@ -11,12 +12,12 @@ public class CallToolRequestParams : RequestParams
|
|||
/// <summary>
|
||||
/// Tool name.
|
||||
/// </summary>
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
[JsonPropertyName("name")]
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional arguments to pass to the tool.
|
||||
/// </summary>
|
||||
[System.Text.Json.Serialization.JsonPropertyName("arguments")]
|
||||
public Dictionary<string, JsonElement>? Arguments { get; init; }
|
||||
[JsonPropertyName("arguments")]
|
||||
public IReadOnlyDictionary<string, JsonElement>? Arguments { get; init; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
namespace ModelContextProtocol.Protocol.Types;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol.Types;
|
||||
|
||||
/// <summary>
|
||||
/// Used by the client to get a prompt provided by the server.
|
||||
|
|
@ -9,12 +12,12 @@ public class GetPromptRequestParams : RequestParams
|
|||
/// <summary>
|
||||
/// he name of the prompt or prompt template.
|
||||
/// </summary>
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
[JsonPropertyName("name")]
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Arguments to use for templating the prompt.
|
||||
/// </summary>
|
||||
[System.Text.Json.Serialization.JsonPropertyName("arguments")]
|
||||
public Dictionary<string, object>? Arguments { get; init; }
|
||||
[JsonPropertyName("arguments")]
|
||||
public IReadOnlyDictionary<string, JsonElement>? Arguments { get; init; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue