Cairnloop.Tool.Spec (cairnloop v0.5.1)

Copy Markdown View Source

Pure data struct carrying compile-time governed-tool metadata.

No behaviour, no database — just a plain defstruct with enforced required fields. Forward-compatible with MCP tool definition projection (Phase 17): the Spec fields map directly to an MCP tool definition with zero model change.

MCP-01 projection seam (Phase 17)

The %Cairnloop.Tool.Spec{} fields project to MCP as:

  • title → MCP title
  • description → MCP description
  • tool module name → MCP name
  • changeset/2 Ecto embedded schema → MCP inputSchema (JSON Schema projection)

Phase 17 performs this projection as a pure Spec → map transformation with no behaviour or database involvement.

Summary

Types

t()

@type t() :: %Cairnloop.Tool.Spec{
  approval_mode: atom(),
  description: String.t() | nil,
  idempotency: atom() | map() | nil,
  result_states: [atom()] | nil,
  risk_tier: atom(),
  title: String.t() | nil
}