Wait for text

wait_for_text

wait_for_text
readonly tool

Wait for text to appear in a tmux pane.

Use when you need to block until specific output appears — waiting for a server to start, a build to complete, or a prompt to return.

Avoid when the expected text may never appear — always set a reasonable timeout. For known output, capture_pane after a known delay may suffice, but wait_for_text is preferred because it adapts to variable timing.

Side effects: None. Readonly. Blocks until text appears or timeout.

Example:

{
  "tool": "wait_for_text",
  "arguments": {
    "pattern": "Server listening",
    "pane_id": "%2",
    "timeout": 30
  }
}

Response:

{
  "found": true,
  "matched_lines": [
    "Server listening on port 8000"
  ],
  "pane_id": "%2",
  "elapsed_seconds": 0.002,
  "timed_out": false
}

Parameters

Parameter

Type

Required

Default

Description

pattern

str

yes

Text to wait for. Treated as literal text by default. Set regex=True to interpret as a regular expression.

regex

bool

no

False

Whether to interpret pattern as a regular expression. Default False (literal text matching).

pane_id

str

no

Pane ID (e.g. ‘%1’).

session_name

str

no

Session name for pane resolution.

session_id

str

no

Session ID (e.g. ‘$1’) for pane resolution.

window_id

str

no

Window ID for pane resolution.

timeout

float

no

8.0

Maximum seconds to wait. Default 8.0.

interval

float

no

0.05

Seconds between polls. Default 0.05 (50ms).

match_case

bool

no

False

Whether to match case. Default False (case-insensitive).

content_start

int

no

Start line for capture. Negative values reach into scrollback.

content_end

int

no

End line for capture.

socket_name

str

no

tmux socket name.

ctx

Context

no

FastMCP context; when injected the tool reports progress to the client. Omitted in tests.