Skip to content

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

Samples:
~60 tokens (est.)

Step 1: Define tools

Conversation timeline

U
User#1~9 tokens
T
Tool call#2~13 tokens
R
Tool response#3~17 tokens
A
Assistant#4~21 tokens
{
  "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

UserTool callTool responseAssistant

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. 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. 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. 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. 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?
Function calling, or tool use, lets a model answer with a structured request to run a named tool with JSON arguments; your code runs it and returns the result. This simulator lets you script that exchange by hand, with tool definitions, calls, mock results and errors, and export it as OpenAI or Anthropic messages.
Why simulate function calling instead of using the API?
Simulation is free, instant, and lets you test edge cases (tool errors, wrong tool selection, multi-step flows) before spending API tokens. It's ideal for designing and validating agent tool configurations.
Can I simulate multi-step tool use?
Yes, chain multiple tool calls to simulate agents that need several steps to complete a task — like searching, then reading results, then summarizing. Each step shows token estimates.
What export formats are supported?
Export the simulated conversation as an OpenAI messages array or an Anthropic messages array, ready to use as a test fixture or in your application code.
Does this make real API calls?
No. Everything is simulated locally in your browser. No API keys needed, no tokens consumed. You manually specify which tool the model would call and provide mock responses.
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.