# ToolCallStream

> **Class** in `langgraph.prebuilt`

📖 [View in docs](https://reference.langchain.com/python/langgraph.prebuilt/_tool_call_stream/ToolCallStream)

Scoped view of a single tool call's lifecycle.

Yielded on `run.tool_calls` once per `tool-started` event. Fields
are populated as events arrive:

- `tool_call_id`, `tool_name`, `input`: stable from the start event.
- `output_deltas`: a `StreamChannel` of delta chunks. Iterate (sync or
  async) to consume partial output in arrival order.
- `output`: terminal payload from `tool-finished`, or `None` if the
  call failed or is still in flight.
- `error`: terminal error string from `tool-error`, or `None` if the
  call succeeded or is still in flight.
- `completed`: True once a terminal event (`tool-finished` or
  `tool-error`) has been observed.

`ToolCallStream` is not meant to be constructed by end users — it's
produced by `ToolCallTransformer` as events flow through the mux.

## Signature

```python
ToolCallStream(
    self,
    tool_call_id: str,
    tool_name: str,
    input: dict[str, Any] | None = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tool_call_id` | `str` | Yes | The `tool_call_id` from the AIMessage. |
| `tool_name` | `str` | Yes | The tool's name. |
| `input` | `dict[str, Any] \| None` | No | The tool's input arguments (as reported by `on_tool_start`), or `None` if none were captured. (default: `None`) |

## Constructors

```python
__init__(
    self,
    tool_call_id: str,
    tool_name: str,
    input: dict[str, Any] | None = None,
) -> None
```

| Name | Type |
|------|------|
| `tool_call_id` | `str` |
| `tool_name` | `str` |
| `input` | `dict[str, Any] \| None` |


## Properties

- `tool_call_id`
- `tool_name`
- `input`
- `output`
- `error`
- `completed`
- `output_deltas`

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/aa322c13cd5f16a3f6254a931a4104e412cd687c/libs/prebuilt/langgraph/prebuilt/_tool_call_stream.py#L17)