Skip to content

JsonWithTools

type JsonWithTools = "response_format" | "prompt";

Defined in: core/src/types.ts:354

How the schema rides on a call that ALSO carries tools.

"response_format" sends both, as the shapes document and most models honour. "prompt" leaves the format off that call and sends the schema as prompt instead, which is what the Anthropic shape has always done.

It is a setting because a model that cannot serve both never says so: its decoder is pinned to the schema, the tool call has nowhere to go, and it writes the announcement instead (“let me look that up”) and stops. Nothing is logged, because nothing failed. probeJsonWithTools answers it in one call; there is no default that is right for every model.