Signal · Structured output
Structured output with tools
For a model that accepts tools or a response_format in one request but not both (capability toolsWithStructuredOutput: false; Groq’s default model is one), Signal omits response_format when tools are set and sends the JSON Schema as a system message. The final response is still validated against the Zod schema. The model’s turns are scripted; no model is called.
{
nativeTools: true,
nativeJsonSchema: true,
toolsWithStructuredOutput: false,
}user
How many seats are left on Saturday?
system
OUTPUT SCHEMA: your final reply must be ONLY a JSON value matching this schema — raw
JSON, no prose, no code fences:
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object",
"properties":{"night":{"type":"string"},"left":{"type":"number"}},
"required":["night","left"],"additionalProperties":false}{
model: 'written-here',
tools: [
{
type: 'function',
function: {
name: 'seatsLeft',
description: 'How many seats are left on a night',
parameters: {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
night: {
type: 'string',
description: 'The night, as YYYY-MM-DD',
},
},
required: ['night'],
additionalProperties: false,
},
},
},
],
stream: true,
stream_options: { include_usage: true },
}{ night: '2026-10-24', left: 113 }Runs in this page on the installed package. The input and the expected output are defined by the example.