Phantom.Tool.Annotation (phantom_mcp v0.3.2)

View Source

Tool annotations provide additional metadata about a tool’s behavior, helping clients understand how to present and manage tools. These annotations are hints that describe the nature and impact of a tool, but should not be relied upon for security decisions

  • :title A human-readable title for the tool, useful for UI display
  • :read_only_hint If true, indicates the tool does not modify its environment
  • :destructive_hint If true, the tool may perform destructive updates (only meaningful when :read_only_hint is false)
  • :idempotent_hint If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when readOnlyHint is false)
  • :open_world_hint If true, the tool may interact with an “open world” of external entities

https://modelcontextprotocol.io/docs/concepts/tools#tool-annotations

Summary

Types

json()

@type json() :: %{
  optional(:title) => String.t(),
  optional(:idempotentHint) => boolean(),
  optional(:destructiveHint) => boolean(),
  optional(:readOnlyHint) => boolean(),
  optional(:openWorldHint) => boolean()
}

t()

@type t() :: %Phantom.Tool.Annotation{
  destructive_hint: boolean(),
  idempotent_hint: boolean(),
  open_world_hint: boolean(),
  read_only_hint: boolean(),
  title: String.t()
}

Functions

build(attrs \\ [])

to_json(annotation)