Function Call Flow Simulator
Script a multi-step tool-calling conversation with mock tool results and errors, then export it as an OpenAI or Anthropic request body.
Function Call Flow Simulator
Step 1: Define tools
Conversation timeline
{
"model": "gpt-6-astra",
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"required": [
"location"],
"properties": {
"location": {
"type": "string",
"description": "City name"},
"units": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"],
"description": "Temperature units"}
}
}
}
}
],
"messages": [
{
"role": "user",
"content": "What's the weather in San Francisco?"},
{
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_step-s2",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"San Francisco\", \"units\": \"fahrenheit\"}"}
}
]
},
{
"role": "tool",
"tool_call_id": "call_step-s2",
"content": "{\"temperature\": 62, \"condition\": \"Partly Cloudy\", \"humidity\": 75}"},
{
"role": "assistant",
"content": "The current weather in San Francisco is 62°F and partly cloudy with 75% humidity."}
]
}Flow pattern
Tool calls can loop (call multiple tools before the final assistant response).
Updated . Provided as is. Check the output before you rely on it in production.
How to use Function Call Flow Simulator
- 1
Define tools
Add each tool with a name, description and JSON Schema parameters, or load a sample flow such as Weather Bot or DB Query Agent.
- 2
Script the conversation
Add user messages, tool calls with arguments, tool responses (including error responses) and assistant replies in the order your agent would produce them.
- 3
Review the flow
The timeline shows the full exchange and the flow pattern, so you can check that every tool call has a matching response.
- 4
Export the messages
Export the conversation as an OpenAI or Anthropic messages array to use as a test fixture or few-shot example.
Questions and answers
What is function calling in AI?
Why simulate function calling instead of using the API?
Can I simulate multi-step tool use?
What export formats are supported?
Does this make real API calls?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/function-call-simulator/
For automation planning, fetch the canonical contract at /api/tool/function-call-simulator.json.