Urchin.Tool (Urchin v0.2.0)

Copy Markdown View Source

A tool definition advertised via tools/list.

Mirrors the Tool type from the MCP schema. input_schema is a JSON Schema object describing the tool arguments; when omitted it defaults to an empty object schema.

Summary

Functions

Builds a tool from a keyword list or map of attributes.

Serializes the tool to its JSON-RPC wire shape.

Types

t()

@type t() :: %Urchin.Tool{
  annotations: map() | nil,
  description: String.t() | nil,
  execution: map() | nil,
  icons: [map()] | nil,
  input_schema: map() | nil,
  meta: map() | nil,
  name: String.t(),
  output_schema: map() | nil,
  title: String.t() | nil
}

Functions

new(attrs)

@spec new(keyword() | map()) :: t()

Builds a tool from a keyword list or map of attributes.

to_map(tool)

@spec to_map(t()) :: map()

Serializes the tool to its JSON-RPC wire shape.