OzMcp.Structs.Annotations (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build Annotations structure.

(MCP protocol: 2025-11-25)

Short example:

%Annotations{}
  |> Annotations.audience(["user", "assistant"])
  |> Annotations.priority(0.8)
  |> Annotations.last_modified("2025-01-12T15:00:58Z")
  |> Annotations.build()

Result:

%{
  priority: 0.8,
  audience: ["user", "assistant"],
  lastModified: "2025-01-12T15:00:58Z"
}

Specification: Annotations

Fields

FieldSetterTypeRequired
audienceaudience/2[String.t()] | nilno
prioritypriority/2number() | nilno
lastModifiedlast_modified/2stringno

Summary

Functions

Checks a priority value. nil (not set) and each number from 0 to 1 are valid: 1 means most important, 0 means least important.

Types

t()

@type t() :: %OzMcp.Structs.Annotations{
  audience: [String.t()] | nil,
  lastModified: String.t() | nil,
  priority: number() | nil
}

Functions

audience(struct, value)

@spec audience(t(), [String.t()] | nil) :: t()

build(struct)

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

last_modified(struct, value)

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

priority(struct, value)

@spec priority(t(), number() | nil) :: t()

validate_priority(value)

@spec validate_priority(term()) :: :ok

Checks a priority value. nil (not set) and each number from 0 to 1 are valid: 1 means most important, 0 means least important.

Spec: priority?: number.