MCPpre-alphaAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

libtmux_mcp.tools.pane_tools.capture_pane

libtmux_mcp.tools.pane_tools.capture_pane ( pane_id: str | None = None, session_name: str | None = None, session_id: str | None = None, window_id: str | None = None, start: int | None = None, end: int | None = None, max_lines: int | None = CAPTURE_DEFAULT_MAX_LINES, socket_name: str | None = None, ) → str

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

Description#

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 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.

Parameters
Returns

str Captured pane content as text. When truncated, the first line is a [... truncated K lines ...] marker.

Esc

Type to search.

Reference preview Open reference