Function Call Mock Response Generator

Generate realistic mock tool-call responses from a JSON Schema for testing LLM integrations.

Ad placeholder (leaderboard)

Function call mock generator

Building the code that handles an LLM’s tool calls means you need example tool-call payloads to test against — but calling the real API for each one is slow and costs tokens. This tool reads your function/tool JSON Schema and synthesises type-correct mock arguments, giving you instant fixtures for your parsing and handler logic.

How it works

The input is parsed as JSON and the tool locates the parameters schema — under function.parameters (OpenAI), input_schema (Anthropic), or at the top level (bare JSON Schema). It then walks the schema recursively: enum fields take their first option, strings derive a plausible value from the property name, numbers take the midpoint of minimum/maximum, booleans default true, arrays produce two sample items, and nested objects recurse. Generation is deterministic, so the same schema always yields the same mock. The result is wrapped in a realistic tool-call envelope you can paste straight into a test.

Tips and notes

  • Every property is included. The generator emits all defined properties, not just the required ones, so the mock exercises your full parsing path.
  • Use enums for realism. Enum constraints produce the most believable mock values since the generator picks a real allowed option.
  • Add minimum/maximum to shape numbers. Numeric fields default to the midpoint of the declared range, so set bounds to get the value you want to test.
  • It validates structure, not semantics. The mock satisfies the schema’s types; it will not invent business-meaningful data, so adjust values by hand where your tests assert on specifics.
Ad placeholder (rectangle)