# capture_pane

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

> Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. The text a pane is showing, or its scrollback. Negative start reaches back into history (-100 is a hundred lines above the top of the screen). For repeated reads of the same pane use capture_since instead — it returns only what is new.

tool MCPlatest

MCP concept example

A working example of the core library. It can change without notice.

[What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **capture_pane**( [end](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2Fend)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [joinWrapped](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FjoinWrapped)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [maxLines](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FmaxLines)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [paneId](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FpaneId): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [start](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2Fstart)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), )

  tool \[[source](https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/tools/capture.ts#L27)][¶](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane)

  Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. The text a pane is showing, or its scrollback. Negative `start` reaches back into history (-100 is a hundred lines above the top of the screen). For repeated reads of the same pane use [capture_since](https://libtmux.org/en/ts/latest/mcp/tools/capture_since/) instead — it returns only what is new.

  * MCP request method

    `tools/call` Send `capture_pane` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.parameters)

  * **[`end`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2Fend)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Last line, on the same scale as start: 0 is the top of the visible screen and negative reaches back into history. It does not count back from the bottom, so end:-1 is one line above the screen top, not the last line of output.

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  * **[`joinWrapped`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FjoinWrapped)**? ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Rejoin lines tmux wrapped.

  * **[`maxLines`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FmaxLines)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Keep at most this many lines, from the end. Defaults to the server limit.

    * maximum

      `9007199254740991`

    * exclusiveMinimum

      `0`

  * **[`paneId`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2FpaneId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Stable pane id, e.g. %1.

    * pattern

      `"^%\\d+$"`

  * **[`start`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.input%2Fproperties%2Fstart)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    First line; negative reaches into scrollback.

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  ## Result[#](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`byteClamped`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FbyteClamped)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Whether the byte ceiling shortened the capture.

  * **[`droppedLines`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FdroppedLines)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Lines cut from the front to fit maxLines.

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  * **[`effectiveEnd`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FeffectiveEnd)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Matches one or more variants.

    * **[Variant 1](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FeffectiveEnd%2FanyOf%2F0)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

  * **[`effectiveStart`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FeffectiveStart)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Matches one or more variants.

    * **[Variant 1](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FeffectiveStart%2FanyOf%2F0)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

  * **[`omittedBytes`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FomittedBytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  * **[`paneId`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FpaneId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Stable pane id, e.g. %1.

    * pattern

      `"^%\\d+$"`

  * **[`rangeClamped`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FrangeClamped)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Whether a result ceiling shortened the range.

  * **[`returnedBytes`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FreturnedBytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  * **[`text`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2Ftext)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

  * **[`totalLines`](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.output%2Fproperties%2FtotalLines)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    How many lines the capture held before trimming.

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.annotations)

  * [`destructiveHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/ts/latest/mcp/tools/capture_pane/#mcp.tool.capture_pane.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "end": {
        "description": "Last line, on the same scale as start: 0 is the top of the visible screen and negative reaches back into history. It does not count back from the bottom, so end:-1 is one line above the screen top, not the last line of output.",
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      },
      "joinWrapped": {
        "description": "Rejoin lines tmux wrapped.",
        "type": "boolean"
      },
      "maxLines": {
        "description": "Keep at most this many lines, from the end. Defaults to the server limit.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "paneId": {
        "description": "Stable pane id, e.g. %1.",
        "pattern": "^%\\d+$",
        "type": "string"
      },
      "start": {
        "description": "First line; negative reaches into scrollback.",
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      }
    },
    "required": [
      "paneId"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "byteClamped": {
        "description": "Whether the byte ceiling shortened the capture.",
        "type": "boolean"
      },
      "droppedLines": {
        "description": "Lines cut from the front to fit maxLines.",
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      },
      "effectiveEnd": {
        "anyOf": [
          {
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "effectiveStart": {
        "anyOf": [
          {
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "omittedBytes": {
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      },
      "paneId": {
        "description": "Stable pane id, e.g. %1.",
        "pattern": "^%\\d+$",
        "type": "string"
      },
      "rangeClamped": {
        "description": "Whether a result ceiling shortened the range.",
        "type": "boolean"
      },
      "returnedBytes": {
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      },
      "text": {
        "type": "string"
      },
      "totalLines": {
        "description": "How many lines the capture held before trimming.",
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      }
    },
    "required": [
      "byteClamped",
      "droppedLines",
      "effectiveEnd",
      "effectiveStart",
      "omittedBytes",
      "paneId",
      "rangeClamped",
      "returnedBytes",
      "text",
      "totalLines"
    ],
    "type": "object"
  }
  ```
