Add ModelContextProtocol.Core package (#428)
This commit is contained in:
parent
57458241b9
commit
703b0fe50b
1 changed files with 239 additions and 94 deletions
37
src/ModelContextProtocol.Core/Protocol/Root.cs
Normal file
37
src/ModelContextProtocol.Core/Protocol/Root.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a root URI and its metadata in the Model Context Protocol.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Root URIs serve as entry points for resource navigation, typically representing
|
||||
/// top-level directories or container resources that can be accessed and traversed.
|
||||
/// Roots provide a hierarchical structure for organizing and accessing resources within the protocol.
|
||||
/// Each root has a URI that uniquely identifies it and optional metadata like a human-readable name.
|
||||
/// </remarks>
|
||||
public class Root
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the URI of the root.
|
||||
/// </summary>
|
||||
[JsonPropertyName("uri")]
|
||||
public required string Uri { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a human-readable name for the root.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets additional metadata for the root.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is reserved by the protocol for future use.
|
||||
/// </remarks>
|
||||
[JsonPropertyName("meta")]
|
||||
public JsonElement? Meta { get; init; }
|
||||
}
|
||||
Loading…
Reference in a new issue