MCPconceptTools

Choose documentation 3

v0.1.0.alpha.3

Current version

v0.1.0.alpha.3
English

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

Ruby MCP reference

tool MCPv0.1.0.alpha.3

tmux_wait

tmux_wait()
tool [source]

Wait for observed literal screen text or the initial pane process exit. Deadline in seconds is capped by the application limit. Pane exit is observed through process descriptors. The screen_contains condition joins wrapped rows, uses control events on tmux>=3.7 and polls the pane screen on older daemons, which take no control client. A pane or tmux server that ends first fails with pane_died and the last rows read in error.capture; a lost control stream fails with observation_lost. Requires tmux>=3.3a and Linux peer pidfds with matching PID namespaces or Darwin kqueue process observation. Reports observed evidence, never remote termination caused by cancellation or an inferred process exit status.

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

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": {
"condition": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"text": {
"maxLength": 4096,
"minLength": 1,
"type": "string"
},
"type": {
"const": "screen_contains"
}
},
"required": [
"type",
"text"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"const": "process_exit"
}
},
"required": [
"type"
],
"type": "object"
}
]
},
"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"
}
]
},
"timeout": {
"exclusiveMinimum": 0,
"maximum": 60,
"type": "number"
}
},
"required": [
"target",
"condition"
],
"type": "object"
}
],
"type": "object"
}
Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"data": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"capture": {
"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"
}
]
},
"condition": {
"const": "screen_contains"
},
"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",
"condition",
"capture"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"condition": {
"const": "process_exit"
},
"exit_status": {
"const": "unobserved"
},
"observed_at": {
"type": "number"
},
"process_generation": {
"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",
"condition",
"process_generation",
"observed_at",
"exit_status"
],
"type": "object"
}
]
},
"ok": {
"const": true
}
},
"required": [
"ok",
"data"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"error": {
"additionalProperties": false,
"properties": {
"capture": {
"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"
}
]
},
"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