McpServer.Tool.Annotations (HTTP MCP Server v0.6.0)
View SourceRepresents behavioral hints and metadata for tools.
Annotations provide additional information about tool behavior that helps clients make informed decisions about when and how to use the tool.
Fields
title- Display title for the toolread_only_hint- True if the tool doesn't modify statedestructive_hint- True if the tool may have side effectsidempotent_hint- True if repeated calls produce the same resultopen_world_hint- True if the tool works with unbounded/external data
Examples
iex> annotations = McpServer.Tool.Annotations.new(
...> title: "Calculator",
...> read_only_hint: true,
...> idempotent_hint: true
...> )
%McpServer.Tool.Annotations{
title: "Calculator",
read_only_hint: true,
idempotent_hint: true
}
Summary
Functions
Creates a new Tool.Annotations struct.
Types
Functions
Creates a new Tool.Annotations struct.
Parameters
opts- Keyword list of annotation options::title- Display title:read_only_hint- Whether the tool is read-only (default: false):destructive_hint- Whether the tool may have side effects (default: true):idempotent_hint- Whether the tool is idempotent (default: false):open_world_hint- Whether the tool works with unbounded data (default: true)
Examples
iex> McpServer.Tool.Annotations.new(title: "Echo Tool")
%McpServer.Tool.Annotations{title: "Echo Tool"}
iex> McpServer.Tool.Annotations.new(
...> read_only_hint: true,
...> destructive_hint: false,
...> idempotent_hint: true,
...> open_world_hint: false
...> )
%McpServer.Tool.Annotations{
read_only_hint: true,
destructive_hint: false,
idempotent_hint: true,
open_world_hint: false
}