Synaptic.Tools.Tool (synaptic v0.3.0-alpha.11)

View Source

Struct describing an LLM-callable tool.

Summary

Functions

Returns the policy-relevant metadata for a tool.

Builds a tool struct from a keyword list or map.

Serializes the tool to an OpenAI-compatible payload.

Types

t()

@type t() :: %Synaptic.Tools.Tool{
  concurrency_safe: boolean(),
  data_class: atom() | String.t(),
  description: String.t(),
  destructive: boolean(),
  handler: (map() -> term()),
  max_result_size: pos_integer() | nil,
  name: String.t(),
  needs_approval: boolean(),
  read_only: boolean(),
  risk: :low | :medium | :high | :critical | nil,
  schema: map()
}

Functions

metadata(tool)

Returns the policy-relevant metadata for a tool.

new(tool)

Builds a tool struct from a keyword list or map.

to_openai(tool)

Serializes the tool to an OpenAI-compatible payload.