name: string

The name of the custom tool, used to identify it in tool calls.

type: "custom"

The type of the custom tool. Always custom.

allowed_callers?: Array<"direct" | "programmatic"> | null

The tool invocation context(s).

minItems1
One of the following:
"direct"
"programmatic"
async?: boolean

Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

defer_loading?: boolean

Whether this tool should be deferred and discovered via tool search.

description?: string

Optional description of the custom tool, used to provide more context.

format?: Text { type } | Grammar { definition, syntax, type }

The input format for the custom tool. Default is unconstrained text.

One of the following:
Text { type }

Unconstrained free-form text.

type: "text"

Unconstrained text format. Always text.

Grammar { definition, syntax, type }

A grammar defined by the user.

definition: string

The grammar definition.

syntax: "lark" | "regex"

The syntax of the grammar definition. One of lark or regex.

One of the following:
"lark"
"regex"
type: "grammar"

Grammar format. Always grammar.