Class RootsCapability
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents a client capability that enables root resource discovery in the Model Context Protocol.
public class RootsCapability
- Inheritance
-
RootsCapability
- Inherited Members
Remarks
When present in ClientCapabilities, it indicates that the client supports listing root URIs that serve as entry points for resource navigation.
The roots capability establishes a mechanism for servers to discover and access the hierarchical structure of resources provided by a client. Root URIs represent top-level entry points from which servers can navigate to access specific resources.
See the schema for details.
Properties
ListChanged
Gets or sets whether the client supports notifications for changes to the roots list.
[JsonPropertyName("listChanged")]
public bool? ListChanged { get; set; }
Property Value
- bool?
Remarks
When set to true, the client can notify servers when roots are added, removed, or modified, allowing servers to refresh their roots cache accordingly. This enables servers to stay synchronized with client-side changes to available roots.
RootsHandler
Gets or sets the handler for RootsList requests.
[JsonIgnore]
public Func<ListRootsRequestParams?, CancellationToken, ValueTask<ListRootsResult>>? RootsHandler { get; set; }
Property Value
Remarks
This handler is invoked when a client sends a RootsList request to retrieve available roots. The handler receives request parameters and should return a ListRootsResult containing the collection of available roots.