Update content according to latest spec (#513)
* Update content according to latest spec * Add Title to a bunch of types * Add _meta to lots of types * Address feedback, more cleanup, fix NAOT test failure
This commit is contained in:
parent
28d65470f4
commit
2bcff315f8
1 changed files with 1700 additions and 853 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol;
|
||||
|
|
@ -6,14 +7,16 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// <summary>
|
||||
/// Represents a tool that the server is capable of calling.
|
||||
/// </summary>
|
||||
public class Tool
|
||||
public sealed class Tool : IBaseMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the tool.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a human-readable description of the tool.
|
||||
/// </summary>
|
||||
|
|
@ -74,7 +77,7 @@ public class Tool
|
|||
/// if an invalid schema is provided.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The schema should describe the shape of the data as returned in <see cref="CallToolResponse.StructuredContent"/>.
|
||||
/// The schema should describe the shape of the data as returned in <see cref="CallToolResult.StructuredContent"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[JsonPropertyName("outputSchema")]
|
||||
|
|
@ -102,4 +105,13 @@ public class Tool
|
|||
/// </remarks>
|
||||
[JsonPropertyName("annotations")]
|
||||
public ToolAnnotations? Annotations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets metadata reserved by MCP for protocol-level metadata.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Implementations must not make assumptions about its contents.
|
||||
/// </remarks>
|
||||
[JsonPropertyName("_meta")]
|
||||
public JsonObject? Meta { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue