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.

Provider capabilities
{
  nativeTools: true,
  nativeJsonSchema: true,
  toolsWithStructuredOutput: false,
}
Conversation, request 1
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}
Rest of request 1
{
  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 },
}
Output, after the tool call
{ night: '2026-10-24', left: 113 }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.