Turning It On
Open a prompt with tools in the Playground, switch to chat mode, and enable Mock tool responses in the chat controls. While the toggle is on, each message you send runs the full tool call loop with mocks: the LLM calls a tool, PromptLayer generates a plausible response, feeds it back, and the loop continues until the model produces a final answer. Mocking applies to every tool in the prompt: registry tools, inline function tools, even tool names the model invents. Mock mode is chat only; Output mode is disabled while the toggle is on.How Mocks Are Generated
Each tool call is answered by an LLM that sees the tool’s definition, the call’s arguments, and the conversation so far. Because the generator reads the conversation history, mocked values stay consistent across turns: an order id invented in turn one is the same order id the return flow sees in turn four, just like a real backend.Response Schemas
Tools in the registry can define a response schema, a JSON Schema describing the tool’s return value. When a tool has one, its mocks are generated against it: correct field names and types, valid enum values, realistic ids and amounts. Add a schema from the Response schema panel in the tool editor, or passresponse_schema when creating a tool or tool version through the API. Schemas are optional; tools without one still get sensible free form mocks.

