# capture_pane

Source: https://libtmux.org/en/py/latest/mcp/tools/capture_pane/

> Capture the visible contents of a tmux pane (terminal scrollback).

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Capture the visible contents of a tmux pane (terminal scrollback).

Use for tmux pane output — ‘capture the build log’, ‘what did the server print’ — not editor file contents. The tool for reading what is displayed in a terminal; use [search\_panes](https://libtmux.org/en/py/latest/mcp/tools/search_panes/) to search across multiple panes at once.

Output is tail-preserved: when the capture exceeds `max_lines` the oldest lines are dropped and the returned string is prefixed with a single `[... truncated K lines ...]` header line so the agent can tell truncation occurred and re-request with a narrower `start`/`end` window or a larger `max_lines` if needed. Pass `max_lines=None` to disable truncation entirely.

[All Python tools](../) · [JSON](../capture_pane.json) · [Source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/pane_tools/__init__.py#L101)

## Arguments

* `end` optional

  End line number.

  Default: `null`.

* `max_lines` optional

  Maximum number of lines to return. Defaults to \`\`CAPTURE\_DEFAULT\_MAX\_LINES\`\`. Pass \`\`None\`\` to return the full capture with no truncation.

  Default: `500`.

* `pane_id` optional

  Pane ID (e.g. '%1').

  Default: `null`.

* `session_id` optional

  Session ID (e.g. '$1') for pane resolution.

  Default: `null`.

* `session_name` optional

  Session name for pane resolution.

  Default: `null`.

* `socket_name` optional

  tmux socket name.

  Default: `null`.

* `start` optional

  Start line number. 0 is the first visible line. Negative values reach into scrollback history (e.g. -100 for last 100 lines).

  Default: `null`.

* `window_id` optional

  Window ID for pane resolution.

  Default: `null`.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.
