MCPconceptTools

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

tool MCPlatest

send_keys

send_keys( enter?: boolean, keys?: Array<string> | null, pane: string, text?: string | null, )
tool [source]

Type text into a pane, press named keys in it, or both. text is sent literally, so C-c in it types those three characters. Use keys for anything without a character of its own — C-c to interrupt a running command, Escape, Up, C-d — which are tmux key names and are interpreted. Text, keys, and optional Enter keep that order in one tmux dispatch. Before input, the configured synchronized-pane cohort is observed; a dead, input-disabled, mode-owned, terminal-attended, or inherited-caller member refuses the whole call, and so does an active run_shell_command, except for keys C-c or C-\ sent alone, which interrupt it. Returned pane IDs describe configured membership, not confirmed delivery. The observation can race with tmux processing the input. A submitted line is remembered briefly so wait_for_text can discount its own echo; an unrecognized key stops that for the pane’s current line rather than mask it inaccurately. Send input to a pane’s program; a shell that receives it runs it with your user’s permissions.

MCP request method
tools/call Send send_keys as the tool name, with the arguments below.

Arguments#

  • enter? = false (boolean) #

    Whether to press Enter afterwards.

  • keys? (Array<string> | null) #

    tmux key names to press, in order, after any text.

    These are interpreted rather than typed, which is the only way to send a key that has no character: C-c to interrupt, Escape, Up, C-d. Sending C-c as text would type those three characters. Omit to press none.

  • pane (string) #

    The %-prefixed pane id.

  • text? (string | null) #

    Text typed literally into the pane. Key names are not interpreted. Omit to type none.

No other arguments are accepted.

Result#

Returns object

  • pane (string) #

    The pane the caller targeted.

  • panes (Array<string>) #

    The effective configured recipient IDs observed before dispatch.

    Membership does not confirm delivery and may change after observation.

Annotations#

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false
title
"Send Keys To Pane"

Protocol data#

Use the complete advertised contract for validation and client integration.

Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"enter": {
"default": false,
"description": "Whether to press Enter afterwards.",
"type": "boolean"
},
"keys": {
"description": "tmux key names to press, in order, after any text.\n\nThese are interpreted rather than typed, which is the only way to send\na key that has no character: `C-c` to interrupt, `Escape`, `Up`,\n`C-d`. Sending `C-c` as `text` would type those three characters.\nOmit to press none.",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"pane": {
"description": "The `%`-prefixed pane id.",
"type": "string"
},
"text": {
"description": "Text typed literally into the pane. Key names are not interpreted. Omit\nto type none.",
"type": [
"string",
"null"
]
}
},
"required": [
"pane"
],
"type": "object"
}
Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"pane": {
"description": "The pane the caller targeted.",
"type": "string"
},
"panes": {
"description": "The effective configured recipient IDs observed before dispatch.\n\nMembership does not confirm delivery and may change after observation.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"pane",
"panes"
],
"type": "object"
}
Esc

Type to search.

Reference previewOpen reference