MCPconceptTools

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

tool MCPlatest

wait_for_exit

wait_for_exit( paneId: string, timeoutMs?: integer, )
tool [source]

Inspect tmux metadata; accepts no client-supplied executable input. Wait until the program in a pane exits and return its exit status or signal. Use it for a pane you did not start, such as a person’s build or a server someone launched; for run_program and start_program, their own results report the exit. A pane that closes on exit still reports its status; a pane killed from outside during the wait has none and answers gone within about two seconds, and a pane id that is already gone is not found. A pane at a shell prompt exits only when the shell does: for a command typed into it, use run_shell_command or wait_for_text. Requires tmux 3.8 or newer.

MCP request method
tools/call Send wait_for_exit as the tool name, with the arguments below.

Arguments#

  • paneId (string) #

    Stable pane id, e.g. %1.

    pattern
    "^%\\d+$"
  • timeoutMs? (integer) #

    How long to wait for the exit: 30 seconds when omitted, clamped by the server ceiling; the result reports what was used, and timed_out leaves the program running.

    maximum
    9007199254740991
    exclusiveMinimum
    0

Result#

Returns object

  • effectiveTimeoutMs (integer) #

    The timeout enforced.

    minimum
    -9007199254740991
    maximum
    9007199254740991
  • exitStatus (integer | null) #

    The exit status, as tmux read it from the pane’s process: null when a signal ended it, with signal set, or when it has not exited.

    Matches one or more variants.

  • outcome ("completed" | "timed_out" | "gone" | "cancelled") #

    completed: the program ended; exitStatus holds its status, or is null with signal set. timed_out: it still runs; call again to keep waiting. gone: the pane was removed without an exit status. cancelled: the request was cancelled.

  • signal (string | null) #

    The signal that ended the program, such as “SIGTERM”; otherwise null.

No other properties are accepted.

Annotations#

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Protocol data#

Use the complete advertised contract for validation and client integration.

Input schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"paneId": {
"description": "Stable pane id, e.g. %1.",
"pattern": "^%\\d+$",
"type": "string"
},
"timeoutMs": {
"description": "How long to wait for the exit: 30 seconds when omitted, clamped by the server ceiling; the result reports what was used, and timed_out leaves the program running.",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
}
},
"required": [
"paneId"
],
"type": "object"
}
Output schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"effectiveTimeoutMs": {
"description": "The timeout enforced.",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
"exitStatus": {
"anyOf": [
{
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"type": "integer"
},
{
"type": "null"
}
],
"description": "The exit status, as tmux read it from the pane's process: null when a signal ended it, with signal set, or when it has not exited."
},
"outcome": {
"description": "completed: the program ended; exitStatus holds its status, or is null with signal set. timed_out: it still runs; call again to keep waiting. gone: the pane was removed without an exit status. cancelled: the request was cancelled.",
"enum": [
"completed",
"timed_out",
"gone",
"cancelled"
],
"type": "string"
},
"signal": {
"description": "The signal that ended the program, such as \"SIGTERM\"; otherwise null.",
"type": [
"string",
"null"
]
}
},
"required": [
"effectiveTimeoutMs",
"exitStatus",
"outcome",
"signal"
],
"type": "object"
}
Esc

Type to search.

Reference previewOpen reference