MCP conceptTools

Choose documentation 3

Concept and alpha: example support scope and release maturity.

v0.1.0.alpha.2

Current version

v0.1.0.alpha.2
English

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

toolMCPv0.1.0.alpha.2

tmux_capture

tmux_capture()
tool[source]

Read exact-pane screen/history rows preserving LF. Defaults: 200 lines, 65536 bytes, zero history lines, track=false. Limits: 1000 lines/history, 262144 bytes. UTF-8 or base64; truncation is separate from unknown history continuity. Tracked process cursors require tmux>=3.3a and a native process identity backend: Linux peer pidfds with matching PID namespaces, or Darwin kqueue process observation. Continuation returns an exact state row splice, not a live-output journal. Refuses capture after-hooks.

MCP request method
tools/call Send tmux_capture as the tool name, with the arguments below.
Tool selection
Opt in with --enable-tool tmux_capture.

Arguments#

No named arguments.

Matches exactly one variant.

Result#

Returns object | object

Matches exactly one variant.

Annotations#

destructiveHint
false
idempotentHint
false
openWorldHint
false
readOnlyHint
false

Protocol data#

Use the complete advertised contract for validation and client integration.

Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"history_lines": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"max_bytes": {
"maximum": 262144,
"minimum": 1,
"type": "integer"
},
"max_lines": {
"maximum": 1000,
"minimum": 1,
"type": "integer"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
},
"track": {
"type": "boolean"
}
},
"required": [
"target"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"cursor": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
}
},
"required": [
"target",
"cursor"
],
"type": "object"
}
],
"type": "object"
}
Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"data": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"bytes": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"capture_id": {
"type": "string"
},
"encoding": {
"enum": [
"utf-8",
"base64"
]
},
"history_continuity": {
"const": "unknown"
},
"interval": {
"additionalProperties": false,
"properties": {
"clock": {
"const": "monotonic_seconds"
},
"finished": {
"type": "number"
},
"started": {
"type": "number"
}
},
"required": [
"clock",
"started",
"finished"
],
"type": "object"
},
"mode": {
"const": "snapshot"
},
"next_cursor": {
"type": "string"
},
"process_generation": {
"type": [
"string",
"null"
]
},
"row_count": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"rows": {
"items": {
"type": "string"
},
"maxItems": 1000,
"type": "array"
},
"scope": {
"additionalProperties": false,
"properties": {
"history_lines": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"max_bytes": {
"maximum": 262144,
"minimum": 1,
"type": "integer"
},
"max_lines": {
"maximum": 1000,
"minimum": 1,
"type": "integer"
}
},
"required": [
"max_lines",
"max_bytes",
"history_lines"
],
"type": "object"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
},
"truncated": {
"type": "boolean"
}
},
"required": [
"target",
"capture_id",
"process_generation",
"encoding",
"row_count",
"bytes",
"truncated",
"history_continuity",
"interval",
"scope",
"mode",
"rows"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"base_capture_id": {
"type": "string"
},
"bytes": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"capture_id": {
"type": "string"
},
"encoding": {
"enum": [
"utf-8",
"base64"
]
},
"history_continuity": {
"const": "unknown"
},
"interval": {
"additionalProperties": false,
"properties": {
"clock": {
"const": "monotonic_seconds"
},
"finished": {
"type": "number"
},
"started": {
"type": "number"
}
},
"required": [
"clock",
"started",
"finished"
],
"type": "object"
},
"mode": {
"const": "delta"
},
"next_cursor": {
"type": "string"
},
"process_generation": {
"type": [
"string",
"null"
]
},
"reset": {
"type": "boolean"
},
"row_count": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"scope": {
"additionalProperties": false,
"properties": {
"history_lines": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"max_bytes": {
"maximum": 262144,
"minimum": 1,
"type": "integer"
},
"max_lines": {
"maximum": 1000,
"minimum": 1,
"type": "integer"
}
},
"required": [
"max_lines",
"max_bytes",
"history_lines"
],
"type": "object"
},
"splice": {
"additionalProperties": false,
"properties": {
"delete": {
"minimum": 0,
"type": "integer"
},
"rows": {
"items": {
"type": "string"
},
"maxItems": 1000,
"type": "array"
},
"start": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"start",
"delete",
"rows"
],
"type": "object"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
},
"truncated": {
"type": "boolean"
}
},
"required": [
"target",
"capture_id",
"process_generation",
"encoding",
"row_count",
"bytes",
"truncated",
"history_continuity",
"interval",
"scope",
"mode",
"base_capture_id",
"reset",
"splice",
"next_cursor"
],
"type": "object"
}
]
},
"ok": {
"const": true
}
},
"required": [
"ok",
"data"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"error": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"delivery": {
"enum": [
"not_sent",
"possibly_sent",
"observed"
]
},
"effects": {
"additionalProperties": false,
"properties": {
"created": {
"items": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^\\$[0-9]+$",
"type": "string"
},
"kind": {
"const": "session"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^@[0-9]+$",
"type": "string"
},
"kind": {
"const": "window"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^@[0-9]+$",
"type": "string"
},
"index": {
"minimum": 0,
"type": "integer"
},
"kind": {
"const": "window_link"
},
"session_id": {
"maxLength": 32,
"pattern": "^\\$[0-9]+$",
"type": "string"
}
},
"required": [
"generation",
"kind",
"id",
"session_id",
"index"
],
"type": "object"
}
]
},
"maxItems": 3,
"type": "array"
},
"state": {
"enum": [
"none",
"known",
"unknown"
]
}
},
"required": [
"state",
"created"
],
"type": "object"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message",
"delivery"
],
"type": "object"
},
"ok": {
"const": false
}
},
"required": [
"ok",
"error"
],
"type": "object"
}
],
"type": "object"
}
Esc

Type to search.

Reference preview Open reference