# wait_for_channel

Source: https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/

> Block until a tmux wait-for channel is signalled.

tool MCPstable

MCP is in development

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

* **wait_for_channel**( [channel](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Fchannel): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [socket_name](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Fsocket_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [timeout](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Ftimeout)?: [number](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/wait_for_tools.py#L322)][¶](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel)

  Block until a tmux [`wait-for`](https://libtmux.org/en/tmux/latest/manual/wait-for/) channel is signalled.

  This is the AUTHORED-output synchronisation primitive: the channel only fires because your own composed shell command signals it. Reserve [`wait_for_text`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_text/) for output you did not author.

  Agents can compose this with [`send_keys`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/) to turn shell-side milestones into explicit synchronisation points::

  ```plaintext
  send_keys(
      "pytest; tmux wait-for -S tests_done",
      pane_id=...,
  )
  wait_for_channel("tests_done", timeout=60)
  ```

  Shell `;` semantics fire [`wait-for -S`](https://libtmux.org/en/tmux/latest/manual/wait-for/ "tmux command") whether the command succeeded or failed, so the edge-triggered signal never deadlocks on a crash. Do NOT chain `exit $status` after the signal — in an interactive shell that exits the shell itself, which destroys single-pane sessions. Exit-status preservation in interactive shells is out-of-scope; inspect the captured output for command-specific success markers.

  * MCP request method

    `tools/call` Send `wait_for_channel` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.parameters)

  * **[`channel`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Fchannel)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Channel name. Must match `^[A-Za-z0-9_.:-]{1,128}$`.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Fsocket_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    tmux socket name.

  * **[`timeout`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.input%2Fproperties%2Ftimeout)**? = `30` ([number](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Maximum seconds to wait. The underlying [`tmux wait-for`](https://libtmux.org/en/tmux/latest/manual/wait-for/) has no built-in timeout — this wrapper enforces it by killing the tmux child, which also happens if the call is cancelled. Defaults to 30 seconds. Capped by the same server wait ceiling as [`wait_for_text`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_text/); an over-large value is not an error, the wait returns at the ceiling and the confirmation message names the timeout that was actually enforced.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`result`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.output%2Fproperties%2Fresult)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

  ## Annotations[#](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.annotations)

  * [`destructiveHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/#mcp.tool.wait_for_channel.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "channel": {
        "description": "Channel name. Must match ``^[A-Za-z0-9_.:-]{1,128}$``.",
        "type": "string"
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "tmux socket name."
      },
      "timeout": {
        "default": 30,
        "description": "Maximum seconds to wait. The underlying ``tmux wait-for`` has\nno built-in timeout — this wrapper enforces it by killing the\ntmux child, which also happens if the call is cancelled.\nDefaults to 30 seconds. Capped by the same server wait ceiling\nas ``wait_for_text``; an over-large value is not an error, the\nwait returns at the ceiling and the confirmation message names\nthe timeout that was actually enforced.",
        "type": "number"
      }
    },
    "required": [
      "channel"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "properties": {
      "result": {
        "type": "string"
      }
    },
    "required": [
      "result"
    ],
    "type": "object",
    "x-fastmcp-wrap-result": true
  }
  ```
