# ToolGroupSummary

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary)

Collapsed one-line stand-in for an assistant step's tool calls.

Tools are hidden from the moment they start; this single line shows live
progress ("Running 1 shell command…") and flips to the past tense
("Ran 1 shell command") once every tool finishes. Clicking the line or
pressing Ctrl+O expands the underlying tool rows (and their diffs).

Two modes:

- **live** (streaming): created empty, members added via `add_member` as
  they mount, a spinner timer animates the line and re-renders present/past
  tense, and failed tools are ejected back into view so errors stay visible.
- **finalized** (`live=False`, used for hydration/resume): a fixed set of
  completed tools rendered straight to the past tense with no timer.

Purely presentational — never tracked by the message store; it is re-derived
from the mounted tool widgets on each stream boundary and on hydration.

## Signature

```python
ToolGroupSummary(
    self,
    tools: list[ToolCallMessage] | None = None,
    collapsible: list[Widget] | None = None,
    *,
    live: bool = False,
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tools` | `list[ToolCallMessage] \| None` | No | Tool widgets the summary aggregates (drives its text). May be empty for a live group that grows via `add_member`. (default: `None`) |
| `collapsible` | `list[Widget] \| None` | No | Every widget hidden/shown with the group, including the tool widgets and any interleaved diff previews. (default: `None`) |
| `live` | `bool` | No | When True, animate progress and accept new members until `close`. When False, render a finalized past-tense summary. (default: `False`) |
| `**kwargs` | `Any` | No | Additional arguments passed to `Static`. (default: `{}`) |

## Extends

- `Static`

## Constructors

```python
__init__(
    self,
    tools: list[ToolCallMessage] | None = None,
    collapsible: list[Widget] | None = None,
    *,
    live: bool = False,
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `tools` | `list[ToolCallMessage] \| None` |
| `collapsible` | `list[Widget] \| None` |
| `live` | `bool` |


## Properties

- `DEFAULT_CSS`
- `has_attached_members`

## Methods

- [`on_mount()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/on_mount)
- [`add_member()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/add_member)
- [`add_collapsible()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/add_collapsible)
- [`close()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/close)
- [`toggle()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/toggle)
- [`watch__collapsed()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/watch__collapsed)
- [`on_click()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/messages/ToolGroupSummary/on_click)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2f56309d821db4a0d06ee03959cf842c91b7f228/libs/code/deepagents_code/tui/widgets/messages.py#L2942)