Auggyv0.5.0
PublishedDocs / Reference

defineTool

Define a typed model-callable function with validation and optional authorization requirements.

Shape

Tool definitionTypeScript
defineTool({
  name: "save_lead",
  description: "Save a lead for creator follow-up.",
  category: "business",
  input: z.object({
    email: z.string().email(),
    need: z.string(),
  }),
  execute: async (input) => JSON.stringify({ lead: await saveLead(input) }),
});

Options

OptionUse
nameTool identifier the model calls; imperative or domain terms work best.
descriptionWhat the tool does and when to use it; the model selects tools from this.
categoryGrouping label such as business or commerce.
inputZod schema that validates model-provided input before execute runs.
executeAsync function receiving validated input; returns a string, usually JSON.
requiresOptional advanced preview delegated authorization rule: { action, resource: { input } }.

Guidance

  • Use names that describe the operation in imperative or domain terms.
  • Keep descriptions specific enough for tool selection.
  • Keep input schemas narrow and explicit.
  • Use skills for workflow teaching that does not fit in the tool description.
  • Use the preview requires surface only when app-owned delegated authorization should gate execution.

Related