# send_keys_batch

Source: https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/

> Send input to a pane's program; a shell that receives it runs it with your user's permissions. Send an ordered batch of pane-input operations, resolving and checking each row's configured cohort immediately before input. Stop or continue on error.

tool MCPlatest

MCP concept example

A working example of the core library. It can change without notice.

[What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **send_keys_batch**( [onError](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2FonError)?: "stop" | "continue", [operations](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations): [Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>, )

  tool \[[source](https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/tools/target.ts#L468)][¶](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch)

  Send input to a pane’s program; a shell that receives it runs it with your user’s permissions. Send an ordered batch of pane-input operations, resolving and checking each row’s configured cohort immediately before input. Stop or continue on error.

  * MCP request method

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

  ## Arguments[#](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.parameters)

  * **[`onError`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2FonError)**? ("stop" | "continue")

    Whether a failed operation ends the batch. Defaults to stop.

  * **[`operations`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

    The key sends to run, in order, one pane each.

    * minItems

      `1`

    * maxItems

      `64`

    - **[Items](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`enter`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems%2Fproperties%2Fenter)**? ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

        Press Enter afterwards. Default true.

      * **[`force`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems%2Fproperties%2Fforce)**? ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

        Allow this server’s own caller pane, as on [`send_keys`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/).

      * **[`keys`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems%2Fproperties%2Fkeys)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        Keys for this pane, as on [`send_keys`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/).

      * **[`literal`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems%2Fproperties%2Fliteral)**? ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

        Send the text literally rather than resolving key names.

      * **[`paneId`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.input%2Fproperties%2Foperations%2Fitems%2Fproperties%2FpaneId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        Stable pane id, e.g. %1.

        * pattern

          `"^%\\d+$"`

  ## Result[#](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.result)

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

  * **[`completed`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Fcompleted)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    * minimum

      `-9007199254740991`

    * maximum

      `9007199254740991`

  * **[`failures`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ffailures)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

    * **[Items](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ffailures%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`index`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ffailures%2Fitems%2Fproperties%2Findex)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

        * minimum

          `-9007199254740991`

        * maximum

          `9007199254740991`

      * **[`reason`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ffailures%2Fitems%2Fproperties%2Freason)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      No other properties are accepted.

  * **[`targets`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ftargets)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

    * **[Items](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ftargets%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`index`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ftargets%2Fitems%2Fproperties%2Findex)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

        * minimum

          `-9007199254740991`

        * maximum

          `9007199254740991`

      * **[`resolvedPaneIds`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ftargets%2Fitems%2Fproperties%2FresolvedPaneIds)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)")>)

        * **[Items](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.output%2Fproperties%2Ftargets%2Fitems%2Fproperties%2FresolvedPaneIds%2Fitems)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          Stable pane id, e.g. %1.

          * pattern

            `"^%\\d+$"`

      No other properties are accepted.

  No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.annotations)

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

    `true`

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

    `false`

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

    `true`

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

    `false`

  ## Protocol data[#](https://libtmux.org/en/ts/latest/mcp/tools/send_keys_batch/#mcp.tool.send_keys_batch.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "onError": {
        "description": "Whether a failed operation ends the batch. Defaults to stop.",
        "enum": [
          "stop",
          "continue"
        ],
        "type": "string"
      },
      "operations": {
        "description": "The key sends to run, in order, one pane each.",
        "items": {
          "properties": {
            "enter": {
              "description": "Press Enter afterwards. Default true.",
              "type": "boolean"
            },
            "force": {
              "description": "Allow this server's own caller pane, as on `send_keys`.",
              "type": "boolean"
            },
            "keys": {
              "description": "Keys for this pane, as on `send_keys`.",
              "type": "string"
            },
            "literal": {
              "description": "Send the text literally rather than resolving key names.",
              "type": "boolean"
            },
            "paneId": {
              "description": "Stable pane id, e.g. %1.",
              "pattern": "^%\\d+$",
              "type": "string"
            }
          },
          "required": [
            "keys",
            "paneId"
          ],
          "type": "object"
        },
        "maxItems": 64,
        "minItems": 1,
        "type": "array"
      }
    },
    "required": [
      "operations"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "completed": {
        "maximum": 9007199254740991,
        "minimum": -9007199254740991,
        "type": "integer"
      },
      "failures": {
        "items": {
          "additionalProperties": false,
          "properties": {
            "index": {
              "maximum": 9007199254740991,
              "minimum": -9007199254740991,
              "type": "integer"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "index",
            "reason"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "targets": {
        "items": {
          "additionalProperties": false,
          "properties": {
            "index": {
              "maximum": 9007199254740991,
              "minimum": -9007199254740991,
              "type": "integer"
            },
            "resolvedPaneIds": {
              "items": {
                "description": "Stable pane id, e.g. %1.",
                "pattern": "^%\\d+$",
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "index",
            "resolvedPaneIds"
          ],
          "type": "object"
        },
        "type": "array"
      }
    },
    "required": [
      "completed",
      "failures",
      "targets"
    ],
    "type": "object"
  }
  ```
