OzMcp.Structs.ToolAnnotations (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build ToolAnnotations structure.

(MCP protocol: 2025-11-25)

Short example:

%ToolAnnotations{}
  |> ToolAnnotations.title("Search Tool")
  |> ToolAnnotations.read_only_hint(true)
  |> ToolAnnotations.build()

Result:

%{title: "Search Tool", readOnlyHint: true}

Specification: ToolAnnotations

Fields

FieldSetterTypeRequired
titletitle/2stringno
readOnlyHintread_only_hint/2booleanno
destructiveHintdestructive_hint/2booleanno
idempotentHintidempotent_hint/2booleanno
openWorldHintopen_world_hint/2booleanno

Summary

Types

t()

@type t() :: %OzMcp.Structs.ToolAnnotations{
  destructiveHint: boolean() | nil,
  idempotentHint: boolean() | nil,
  openWorldHint: boolean() | nil,
  readOnlyHint: boolean() | nil,
  title: String.t() | nil
}

Functions

build(struct)

@spec build(t()) :: map()

destructive_hint(struct, value)

@spec destructive_hint(t(), boolean() | nil) :: t()

idempotent_hint(struct, value)

@spec idempotent_hint(t(), boolean() | nil) :: t()

open_world_hint(struct, value)

@spec open_world_hint(t(), boolean() | nil) :: t()

read_only_hint(struct, value)

@spec read_only_hint(t(), boolean() | nil) :: t()

title(struct, value)

@spec title(t(), String.t() | nil) :: t()