Urchin.Tool (Urchin v0.4.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 default_input_schema/0, an object that accepts no properties.

Summary

Functions

The input schema advertised for a tool that declares none: an object accepting no properties, per the MCP recommendation for parameterless tools.

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

default_input_schema()

@spec default_input_schema() :: map()

The input schema advertised for a tool that declares none: an object accepting no properties, per the MCP recommendation for parameterless tools.

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.