Signal · Tool calling

Invalid tool arguments

When a tool call’s arguments fail the tool’s input schema, Signal does not run the function: it returns the validation error to the model as the tool result, and the model can call the tool again. An unknown tool name and a function that throws are reported the same way, and none of the three fails the call. Example: night arrives as a number; the model’s turns are scripted and no model is called.

Tool
defineTool({
  name: 'seatsLeft',
  description: 'How many seats are left on a night',
  input: z.object({ night: z.string().describe('The night, as YYYY-MM-DD') }),
  execute: ({ night }) => ({ night, left: seatsLeftOn(night) }),
})
Prompt
'How many seats are left on Saturday?'
Run, turn by turn
Scripted model reply
{ calls: [{ name: 'seatsLeft', args: '{"night":24}' }] }
Output matches the expected value

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