# wait_for_text

Source: https://libtmux.org/en/csharp/latest/mcp/tools/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.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

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](https://libtmux.org/en/csharp/latest/mcp/tools/run_shell_command/) is better: it reports the real exit status instead of guessing from text. Never poll [capture_pane](https://libtmux.org/en/csharp/latest/mcp/tools/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](https://libtmux.org/en/csharp/latest/mcp/tools/) · [JSON](https://libtmux.org/en/csharp/latest/mcp/tools/wait_for_text.json) · [Source](https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.Mcp/Policy/CapabilityModel.cs#L581)

## 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

```json
{
  "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

```json
{
  "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

```json
{
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": true,
  "readOnlyHint": false,
  "title": "Wait for text"
}
```
