Class ToolAnnotations
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents additional properties describing a Tool to clients.
public 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 whether the tool may perform destructive updates to its environment.
[JsonPropertyName("destructiveHint")]
public bool? DestructiveHint { get; set; }
Property Value
- bool?
Remarks
If true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates. This property is most relevant when the tool modifies its environment (ReadOnly = false).
The default is true.
IdempotentHint
Gets or sets whether calling the tool repeatedly with the same arguments will have no additional effect on its environment.
[JsonPropertyName("idempotentHint")]
public bool? IdempotentHint { get; set; }
Property Value
- bool?
Remarks
This property is most relevant when the tool modifies its environment (ReadOnly = false).
The default is false.
OpenWorldHint
Gets or sets whether this tool may interact with an "open world" of external entities.
[JsonPropertyName("openWorldHint")]
public bool? OpenWorldHint { get; set; }
Property Value
- bool?
Remarks
If true, the tool may interact with an unpredictable or dynamic set of entities (like web search). If false, the tool's domain of interaction is closed and well-defined (like memory access).
The default is true.
ReadOnlyHint
Gets or sets whether this tool does not modify its environment.
[JsonPropertyName("readOnlyHint")]
public bool? ReadOnlyHint { get; set; }
Property Value
- bool?
Remarks
If true, the tool only performs read operations without changing state. If false, the tool may make modifications to its environment.
Read-only tools do not have side effects beyond computational resource usage. They don't create, update, or delete data in any system.
The default is false.
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.