# send_keys

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

> Send keys (commands or text) to a tmux pane.

tool MCPstable

MCP is in development

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

* **send_keys**( [enter](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fenter)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [keys](https://libtmux.org/en/py/stable/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/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fliteral)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [pane_id](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fpane_id)?: [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)"), [session_id](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsession_id)?: [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)"), [session_name](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsession_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)"), [socket_name](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.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)"), [suppress_history](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsuppress_history)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [window_id](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fwindow_id)?: [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)"), )

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

  Send keys (commands or text) to a tmux pane.

  Use this for raw interactive input: TUI keys, control sequences, partial shell input, or persistent shell state. Use [`send_keys_batch`](https://libtmux.org/en/py/stable/mcp/tools/send_keys_batch/) when you need several ordered raw-input operations.

  For authored shell commands that need completion, exit status, or captured output, use [`run_command`](https://libtmux.org/en/py/stable/mcp/tools/run_command/) instead. For custom completion outside that shape, compose [`tmux wait-for -S <channel>`](https://libtmux.org/en/tmux/latest/manual/wait-for/) into the shell command and call [`wait_for_channel`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_channel/). For repeated observation after input, prefer [`capture_since`](https://libtmux.org/en/py/stable/mcp/tools/capture_since/); reserve [`wait_for_text`](https://libtmux.org/en/py/stable/mcp/tools/wait_for_text/) for output the agent does not author.

  Do NOT call [`capture_pane`](https://libtmux.org/en/py/stable/mcp/tools/capture_pane/) immediately — both the read and the pattern-match paths race the pane’s PTY draw.

  * MCP request method

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

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

  * **[`enter`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fenter)**? = `true` ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Whether to press Enter after sending keys. Default True.

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

    The keys or text to send.

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

    Whether to send keys literally (no tmux interpretation). Default False.

  * **[`pane_id`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fpane_id)**? = `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)"))

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

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsession_id)**? = `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)"))

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

  * **[`session_name`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsession_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)"))

    Session name for pane resolution.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.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.

  * **[`suppress_history`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fsuppress_history)**? = `false` ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Suppress shell history by prepending a space; only effective where the shell ignores space-prefixed commands. Default False.

  * **[`window_id`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.input%2Fproperties%2Fwindow_id)**? = `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)"))

    Window ID for pane resolution.

  No other arguments are accepted.

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

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

  * **[`result`](https://libtmux.org/en/py/stable/mcp/tools/send_keys/#mcp.tool.send_keys.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/send_keys/#mcp.tool.send_keys.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/send_keys/#mcp.tool.send_keys.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "enter": {
        "default": true,
        "description": "Whether to press Enter after sending keys. Default True.",
        "type": "boolean"
      },
      "keys": {
        "description": "The keys or text to send.",
        "type": "string"
      },
      "literal": {
        "default": false,
        "description": "Whether to send keys literally (no tmux interpretation). Default False.",
        "type": "boolean"
      },
      "pane_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Pane ID (e.g. '%1')."
      },
      "session_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session ID (e.g. '$1') for pane resolution."
      },
      "session_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session name for pane resolution."
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "tmux socket name."
      },
      "suppress_history": {
        "default": false,
        "description": "Suppress shell history by prepending a space; only effective where\nthe shell ignores space-prefixed commands. Default False.",
        "type": "boolean"
      },
      "window_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Window ID for pane resolution."
      }
    },
    "required": [
      "keys"
    ],
    "type": "object"
  }
  ```

  Output schema

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