> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# SimulatedCall

> The outcome of one tool call in a CallSimulator run, with its result, whether it ran, and what blocked it.

[call]: /docs/server-sdks/reference/python/agents/testing/call-simulator/call

[replay]: /docs/server-sdks/reference/python/agents/testing/call-simulator/replay

[calls]: /docs/server-sdks/reference/python/agents/testing/call-simulator

What one tool call came to in the simulation. [`CallSimulator.call()`][call] and
[`replay()`][replay] return it, and [`CallSimulator.calls`][calls] keeps every one.

```python
from signalwire.testing import SimulatedCall
```

## Properties

**`name`** `str`

The tool's name.

---

**`args`** `dict[str, Any]`

The arguments the model sent.

---

**`result`** `dict[str, Any]`

The result as the platform gets it: `response`, and `action` when the result has
actions.

---

**`ran`** `bool`

Whether the tool's handler, or its stub, ran.

---

**`blocked_by`** `str | None`

Why the tool didn't run: `"step"` for a tool the current step doesn't offer (or a
navigation the step doesn't allow), or the id of the semantic gate that blocked
it. `None` when it ran.

---

**`response`** `str`

The result's text: its `response`, or the `tool_result` of a structured response.

---

**`tool_prompt`** `str | None`

The result's `tool_prompt`, when it has one.

---

**`actions`** `list[dict[str, Any]]`

The result's actions.

---

## Example

```python {12-15}
from signalwire import AgentBase, FunctionResult
from signalwire.testing import CallSimulator

agent = AgentBase(name="orders", route="/orders")
agent.prompt_add_section("Role", "You take orders.")
agent.define_tool("place_order", "Place the order", {"type": "object", "properties": {}},
                  lambda args, raw_data: FunctionResult("Order placed.").hangup())
ctx = agent.define_contexts().add_context("default")
ctx.add_step("take").set_text("Take the order.").set_functions("none")
ctx.add_step("confirm").set_text("Confirm the order.").set_functions(["place_order"])

outcome = CallSimulator(agent).call("place_order")
print(outcome.ran, outcome.blocked_by)
# False step
print(outcome.response)
# Nothing ran: place_order isn't available at this point in the call. The steps that offer it: confirm. No tools are available now.
```