Agent / foldkit-agent/metakit

ToolConfig

interface · packages/agent/src/metakit.ts:50

interface ToolConfig<
  Input,
  MessageInput,
  Model,
  Principal,
  Name extends string,
> {
  readonly name?: Name
  readonly description: string
  readonly toMessage?: (
    input: Input,
    context: InvocationContext<Model, Principal>,
  ) => MessageInput
  readonly authorize?: VariantConfig<
    MessageInput,
    Input,
    Model,
    Principal
  >['authorize']
}

What a tool adds to its transition: words for the agent, and the parts a transition cannot say.

Members

ToolConfig.name

property · packages/agent/src/metakit.ts:52

readonly name?: Name

The protocol-facing name. Defaults to the transition's key in snake_case.

ToolConfig.description

property · packages/agent/src/metakit.ts:53

readonly description: string

ToolConfig.toMessage

property · packages/agent/src/metakit.ts:55

readonly toMessage?: (
  input: Input,
  context: InvocationContext<Model, Principal>,
) => MessageInput

Makes the Message payload from the decoded input. Defaults to the input itself.

ToolConfig.authorize

property · packages/agent/src/metakit.ts:57

readonly authorize?: VariantConfig<
  MessageInput,
  Input,
  Model,
  Principal
>['authorize']

Who may call it. The guard decides whether the state allows it; this decides who.