Skip to main content
Find your agent’s platform below to see what Bluejay mocks for you and what your tool server must do. Pick each tool’s mode first, as shown in Mock tool calls. “Native” means you only turn on Mock tool calls. “Your tool server asks Bluejay” means your tool handler calls the resolver before it runs the real tool.

Turn on mocking

Do this for every platform. Open the agent’s Simulation Settings tab and turn on Mock tool calls. It applies to every simulation on the agent, and each tool starts on Generated. With the API, call PUT /v1/agents/{agent_id}/mock-tools. With MCP or Bluejay AI, ask to mock tool calls for the agent.

ElevenLabs

Bluejay mocks ElevenLabs agents natively on web simulations. Your agent needs versioning turned on in ElevenLabs. When you turn mocking on, Bluejay creates a branch named bluejay-mocks on the agent in your ElevenLabs workspace.
  • The branch is a copy of your live version. It has a client tool in place of each webhook tool, with the same name and schema. Tools set to Real backend stay webhooks and call your server.
  • The branch takes 0% of traffic. Live callers and your main version are never touched.
  • Bluejay reuses the branch for every run. When you publish a new live version, Bluejay rebuilds the branch the next time you queue a run. Changing a tool to or from Real backend rebuilds it right away.
  • Don’t edit the branch. Bluejay overwrites it.
In a simulation, Bluejay connects to the branch, and each tool call comes back to Bluejay instead of your server.
  • Each tool gets the Digital Human’s override, the Fixed response, or a generated result, in that order.
  • If Bluejay can’t produce a result, the tool gets an error, “No mock result is available for this tool in this test.” Your real tool never runs, including calls the agent makes early or drops after an interruption.
To turn mocking off, turn off Mock tool calls. Bluejay archives the branch and deletes its tool copies. Turning it on again creates a new branch. ElevenLabs phone and SIP agents use the resolver, because ElevenLabs can’t route a phone call to a branch. Bluejay sends X-Simulation-Result-Id on every SIP call. Pass it to your tool webhook as a dynamic variable.

Google CES and Dialogflow CX

When Google hands a tool call to Bluejay during a simulation, Bluejay answers it. This works for voice and chat. Turn on mocking. Nothing else is needed.
  • A tool set to Real backend gets an error result, since nothing can run your real tool on this path.
  • A result that is not a JSON object arrives as {"result": <value>}.
  • Tools that Google runs itself, such as OpenAPI tools, still call your real system. Bluejay can’t mock them yet.

Retell, Vapi and other platforms

Retell and Vapi are not yet supported natively. Instead, your tool server asks Bluejay for the mock before it runs the real tool.
  1. Read the Bluejay test id from the call.
  2. Call POST /v1/tool-mocks/resolve with your Bluejay API key.
  3. If mocked is true, return result and skip the real tool. On mocked: false, run the real tool.
Where to find the test id:
A Retell custom function with FastAPI:
  • Only call Bluejay when the call has a test id or comes from a Bluejay number. Real callers then never wait on Bluejay.
  • On mocked: false, run the real tool. When the call has a test id and Bluejay errors or times out, return an error result instead, so a test never reaches your real backend. Generated results can take a few seconds, so wait up to 10.
  • When Bluejay can’t produce a result for a test, it answers mocked: true with an error result.
  • A tool set to Real backend answers mocked: false, so your real tool runs. Every other tool is mocked, generated unless you set it to Fixed.

Custom agents (LiveKit, Pipecat)

When your tools run in your own code, wrap each tool with the Bluejay SDK helper. During a Bluejay simulation it returns the mocked result. On any other call it runs your real tool.

LiveKit

Add @mockable under @function_tool, and call bind_livekit(ctx) at the start of your entrypoint.
The mock is looked up by the function name. If your tool has a different name in Bluejay, use @mockable(name="check_availability").

Pipecat

Bind the call when the bot starts, then wrap the handler body with mock_or_call.

How the helper finds the call

  • bind_livekit reads X-Simulation-Result-Id from the dispatch metadata, then from participant attributes. For SIP calls into LiveKit, map the header with headers_to_attributes on your inbound trunk.
  • On plain phone calls the header is dropped, so bind_livekit falls back to the caller’s number, sip.phoneNumber.
  • In any other server, call bind(test_result_id=...) or bind(caller_number=...) yourself.
A mocked result is returned as a string. Objects are JSON-encoded. Timeouts and the environment variables are in the reference.

Phone

No platform routes a Bluejay caller to a test version on its own, so phone tests always need your tool server to ask Bluejay. Use the resolver or the SDK helper.
  • SIP calls carry X-Simulation-Result-Id. Send it as test_result_id.
  • Phone calls drop SIP headers. Send the Digital Human’s phone number as caller_number, in E.164 form. Bluejay matches it to the Digital Human calling from that number right now.
  • When your agent calls the Digital Human, the Digital Human’s number is the number your agent dialed.
Last modified on November 6, 2026