# send_keys

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

> Send input to a pane's program; a shell that receives it runs it with your user's permissions. Send keystrokes to a pane. Use for TUIs, control keys (C-c), and partial lines. For a shell command whose result you want, use run_shell_command — it waits for completion and reports exit status, which this does not.

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**( [enter](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fenter)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [force](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fforce)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [keys](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fkeys): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [literal](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fliteral)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [paneId](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2FpaneId): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), )

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

  Send input to a pane’s program; a shell that receives it runs it with your user’s permissions. Send keystrokes to a pane. Use for TUIs, control keys (C-c), and partial lines. For a shell command whose result you want, use [run_shell_command](https://libtmux.org/en/ts/latest/mcp/tools/run_shell_command/) — it waits for completion and reports exit status, which this does not.

  * MCP request method

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

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

  * **[`enter`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%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/#mcp.tool.send_keys.input%2Fproperties%2Fforce)**? ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Allow writing to the pane this server itself was called from, which is otherwise refused. It does not override the refusal to write to a pane a person is watching — a pane an attached client has on screen is still refused with force.

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

    Keys to send. tmux key names like C-c work unless literal is true.

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

    Send the text as-is, without resolving key names.

  * **[`paneId`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.input%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/#mcp.tool.send_keys.result)

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

  * **[`attended`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.output%2Fproperties%2Fattended)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    A person is watching a configured cohort member.

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

    Stable pane id, e.g. %1.

    * pattern

      `"^%\\d+$"`

  * **[`resolvedPaneIds`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.output%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)")>)

    Configured cohort at the immediate preflight, not a delivery receipt.

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

      Stable pane id, e.g. %1.

      * pattern

        `"^%\\d+$"`

  * **[`sent`](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.output%2Fproperties%2Fsent)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

  No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ts/latest/mcp/tools/send_keys/#mcp.tool.send_keys.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/#mcp.tool.send_keys.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "enter": {
        "description": "Press Enter afterwards. Default true.",
        "type": "boolean"
      },
      "force": {
        "description": "Allow writing to the pane this server itself was called from, which is otherwise refused. It does not override the refusal to write to a pane a person is watching — a pane an attached client has on screen is still refused with force.",
        "type": "boolean"
      },
      "keys": {
        "description": "Keys to send. tmux key names like C-c work unless literal is true.",
        "type": "string"
      },
      "literal": {
        "description": "Send the text as-is, without resolving key names.",
        "type": "boolean"
      },
      "paneId": {
        "description": "Stable pane id, e.g. %1.",
        "pattern": "^%\\d+$",
        "type": "string"
      }
    },
    "required": [
      "keys",
      "paneId"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "attended": {
        "description": "A person is watching a configured cohort member.",
        "type": "boolean"
      },
      "paneId": {
        "description": "Stable pane id, e.g. %1.",
        "pattern": "^%\\d+$",
        "type": "string"
      },
      "resolvedPaneIds": {
        "description": "Configured cohort at the immediate preflight, not a delivery receipt.",
        "items": {
          "description": "Stable pane id, e.g. %1.",
          "pattern": "^%\\d+$",
          "type": "string"
        },
        "type": "array"
      },
      "sent": {
        "type": "boolean"
      }
    },
    "required": [
      "attended",
      "paneId",
      "resolvedPaneIds",
      "sent"
    ],
    "type": "object"
  }
  ```
