Class ToolAnnotations
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents additional properties describing a Tool to clients.
public sealed class ToolAnnotations
- Inheritance
-
ToolAnnotations
- Inherited Members
Remarks
All properties in ToolAnnotations are hints.
They are not guaranteed to provide a faithful description of tool behavior (including descriptive properties like title).
Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers.
Properties
DestructiveHint
Gets or sets a value that indicates whether the tool can perform destructive updates to its environment.
[JsonPropertyName("destructiveHint")]
public bool? DestructiveHint { get; set; }
Property Value
- bool?
true if the tool can perform destructive updates to its environment; false if the tool performs only additive updates; null if unspecified, in which case clients should assume true.
Remarks
This property is most relevant when the tool modifies its environment (ReadOnly = false).
IdempotentHint
Gets or sets a value that indicates whether calling the tool repeatedly with the same arguments has no additional effect on its environment.
[JsonPropertyName("idempotentHint")]
public bool? IdempotentHint { get; set; }
Property Value
- bool?
true if calling the tool repeatedly with the same arguments has no additional effect on the environment; false if it does; null if unspecified, in which case clients should assume false.
Remarks
This property is most relevant when the tool modifies its environment (ReadOnly = false).
OpenWorldHint
Gets or sets a value that indicates whether this tool can interact with an "open world" of external entities.
[JsonPropertyName("openWorldHint")]
public bool? OpenWorldHint { get; set; }
Property Value
- bool?
true if the tool can interact with an unpredictable or dynamic set of entities (like web search); false if the tool's domain of interaction is closed and well-defined (like memory access); null if unspecified, in which case clients should assume true.
ReadOnlyHint
Gets or sets a value that indicates whether this tool modifies its environment.
[JsonPropertyName("readOnlyHint")]
public bool? ReadOnlyHint { get; set; }
Property Value
- bool?
true if the tool only performs read operations without changing state; false if the tool can make modifications to its environment; null if unspecified, in which case clients should assume false.
Remarks
Read-only tools do not have side effects beyond computational resource usage. They don't create, update, or delete data in any system.
Title
Gets or sets a human-readable title for the tool that can be displayed to users.
[JsonPropertyName("title")]
public string? Title { get; set; }
Property Value
Remarks
The title provides a more descriptive, user-friendly name for the tool than the tool's programmatic name. It is intended for display purposes and to help users understand the tool's purpose at a glance.
Unlike the tool name (which follows programmatic naming conventions), the title can include spaces, special characters, and be phrased in a more natural language style.