Add an answer
- UI
- CLI
- Open Tests, select your suite, and find the test.
- Select its Mock tools cell to open the JSON editor.
- Enter an array of tool mocks. Use the exact tool name and its normal response shape:
- Select Save. If you are creating a new test, also select Save test to save the full test.
answer can contain any JSON value that matches the tool’s real response
shape. The mock returns the same configured result each time that named tool
is called in the simulation.
The mock does not check the tool’s arguments. Add an expected behavior if you
need to check that the agent used the right caller, provider, date, or other
arguments.
Test a failure
Useerror with a string to make the tool fail. In the UI’s Mock tools editor,
use an entry such as {"tool": "book_appointment", "error": "The booking service is unavailable."}.
In a Markdown test file, write:
answer or error. Do not add
delay, status, or matching rules to the envelope.
Use a connection that supports mocks
Retell phone calls do not apply these mock answers. Use text mode or a web call
when your Retell test depends on mocks.
For LiveKit, the
simulation helper is required even when a test has no mocks.
It sends the agent’s spans, reports its tools, and applies the running test’s
mock answers. Set EGMA_URL and EGMA_API_KEY in the worker environment.
If the setup exchange fails, the helper raises NotReported and the agent
session does not start. The monitor helper is for production conversations;
it does not enable simulations.
Check the result
If you edited a local test file, runegma push. Then start a run. Open the
simulation’s transcript and inspect the tool call, its arguments, and its
result. The agent’s trace records both real and mocked tool calls. Calls
answered by the test’s mocks are marked mocked. The transcript prefers the
agent’s tool evidence when it is available.
A misspelled mock name does not match a tool. It creates no tool call or warning,
and the correctly named tool can still run its real implementation.
If a real backend was called, check the exact tool name, connection type, and
LiveKit setup. If the agent reacts incorrectly to the answer, compare
the mock’s response shape with the tool’s actual contract.