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.

MoreLess about this notice

Concept example A working example of the core library. It can change without notice. What concept means

tool MCP

send_keys

Send input to a pane’s program; a shell that receives it runs it with your user’s permissions. Send raw keystrokes to a pane and return immediately. Use for driving an interactive program — a key in vim, a menu choice, Ctrl-C. Set literal=false to send named keys such as C-c, Escape or F5. It refuses the named pane in a human-owned mode and, when source input expands, every synchronized input cohort peer. To run a shell command and learn whether it worked, use run_shell_command instead; this reports nothing about what happens next. Tracks what it sends — including edits such as backspace, Ctrl-U or Ctrl-C — so wait_for_text can tell this pane’s echo apart from real output for a short time afterward.

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

Arguments

No other arguments are accepted.

Result

Returns object

Annotations

Advertised by the server

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false
title
"Send keys"

Capability

Toolset
Execute Start or drive pane processes, or store state that can control later execution.
Process reach
pane-input
tmux effects
change observe

Every C# tool advertises the same annotations, so a host that approves by annotation cannot tell tools apart. The capability row is what tells them apart.

Protocol data

Use the complete advertised contract for validation and client integration.

Input schema
{
"additionalProperties": false,
"properties": {
"enter": {
"default": false,
"description": "Press Enter after the keys.",
"type": "boolean"
},
"keys": {
"description": "Text or a tmux key name.",
"type": "string"
},
"literal": {
"default": true,
"description": "Treat keys as literal text.",
"type": "boolean"
},
"paneId": {
"default": null,
"description": "A pane id. Omit for this server's own pane, or else the one the first session shows.",
"type": [
"string",
"null"
]
},
"suppressHistory": {
"default": false,
"description": "Keep text out of shell history on a best-effort basis.",
"type": "boolean"
}
},
"required": [
"keys"
],
"type": "object"
}
Output schema
{
"properties": {
"changed": {
"type": "string"
},
"paneId": {
"type": "string"
},
"targetPaneIds": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"changed",
"paneId",
"targetPaneIds"
],
"type": "object"
}
Esc
Search in

Type to search.

Reference previewOpen reference