MCPAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

wait_for_text

Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Wait until a pane prints something matching one of these patterns, then return. Use for output you did NOT start — a server’s ready line, another process’s progress, a person typing. A matching pattern already on screen returns PresentAtEntry. For a command you are running yourself, run_shell_command is better: it reports the real exit status instead of guessing from text. Never poll capture_pane in a loop; this call does the waiting. Control observation is required by default; pollingFallback reports activation when the operator permits fallback. Text this server itself typed is discounted while deciding what is new, for a few seconds after it is sent or submitted, so its own echo cannot be the match — except on a pane whose program has not yet configured its terminal; wait for a first prompt before typing into a freshly created pane.

All C# tools · JSON · Source

Arguments

ignoreCase optional · boolean
Ignore case.

Default: true.

paneId optional · string | null
A pane id. Omit for this server's own pane, or else the one the first session shows.

Default: null.

patterns optional · array | null
Linear-time regular expressions that end the wait successfully: .NET syntax without lookarounds, backreferences or atomic groups. Output arriving after this call counts unless the pattern is already present, which returns PresentAtEntry. Omit to return on any new output. Across both pattern lists: at most 32 entries and 16384 UTF-8 bytes; each entry is at most 999 UTF-8 bytes.

Default: null.

stopPatterns optional · array | null
Linear-time regular expressions that stop the wait, in the same subset as patterns. Omit for none. Across both pattern lists: at most 32 entries and 16384 UTF-8 bytes; each entry is at most 999 UTF-8 bytes.

Default: null.

timeoutSeconds optional · number | null
Seconds to wait, lowered to the server's ceiling. Omit to wait the whole ceiling, 30 unless LIBTMUX_MCP_WAIT_MAX_SECONDS sets another.

Default: null.

Schemas

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

Input schema
{
"additionalProperties": false,
"properties": {
"ignoreCase": {
"default": true,
"description": "Ignore case.",
"type": "boolean"
},
"paneId": {
"default": null,
"description": "A pane id. Omit for this server's own pane, or else the one the first session shows.",
"type": [
"string",
"null"
]
},
"patterns": {
"default": null,
"description": "Linear-time regular expressions that end the wait successfully: .NET syntax without lookarounds, backreferences or atomic groups. Output arriving after this call counts unless the pattern is already present, which returns PresentAtEntry. Omit to return on any new output. Across both pattern lists: at most 32 entries and 16384 UTF-8 bytes; each entry is at most 999 UTF-8 bytes.",
"items": {
"type": [
"string",
"null"
]
},
"type": [
"array",
"null"
]
},
"stopPatterns": {
"default": null,
"description": "Linear-time regular expressions that stop the wait, in the same subset as patterns. Omit for none. Across both pattern lists: at most 32 entries and 16384 UTF-8 bytes; each entry is at most 999 UTF-8 bytes.",
"items": {
"type": [
"string",
"null"
]
},
"type": [
"array",
"null"
]
},
"timeoutSeconds": {
"default": null,
"description": "Seconds to wait, lowered to the server's ceiling. Omit to wait the whole ceiling, 30 unless LIBTMUX_MCP_WAIT_MAX_SECONDS sets another.",
"type": [
"number",
"null"
]
}
},
"type": "object"
}
Output schema
{
"properties": {
"anchorLost": {
"type": "boolean"
},
"effectiveTimeoutSeconds": {
"type": "number"
},
"elapsedSeconds": {
"type": "number"
},
"eventsDropped": {
"type": "integer"
},
"linesMissed": {
"type": "boolean"
},
"matchedPattern": {
"type": [
"string",
"null"
]
},
"outcome": {
"enum": [
"Matched",
"AnyOutput",
"Stopped",
"Timeout",
"PaneDied",
"PresentAtEntry"
],
"type": "string"
},
"paneId": {
"type": "string"
},
"pollingFallback": {
"type": "boolean"
},
"tail": {
"properties": {
"droppedBytes": {
"type": "integer"
},
"droppedLines": {
"type": "integer"
},
"lines": {
"items": {
"type": "string"
},
"type": "array"
},
"truncated": {
"type": "boolean"
}
},
"required": [
"lines",
"truncated",
"droppedLines",
"droppedBytes"
],
"type": "object"
}
},
"required": [
"paneId",
"outcome",
"matchedPattern",
"tail",
"elapsedSeconds",
"effectiveTimeoutSeconds"
],
"type": "object"
}
Tool annotations
{
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
"title": "Wait for text"
}
Esc

Type to search.