MCP conceptTools

Choose documentation 3

Concept and alpha: example support scope and release maturity.

v0.1.0.alpha.2

Current version

v0.1.0.alpha.2
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

toolMCPv0.1.0.alpha.2

tmux_run

Run an authored POSIX script in an explicitly enrolled idle, empty zsh 5.9 editor. Opt-in; no terminal injection. Exact queue authorization binds the existing shell generation; execution may follow a later pane replacement without retargeting it. Inherits cwd/exported environment, closed stdin, separate bounded UTF-8/base64 outputs. Defaults: 65536 bytes per output, 65536 script bytes; overflow refuses completion. Reports native exit/signal only from the helper; cancellation never proves descendants stopped.

MCP request method
tools/call Send tmux_run as the tool name, with the arguments below.
Tool selection
Opt in with --enable-tool tmux_run.

Arguments#

additionalProperties
false

Result#

Returns object | object

Matches exactly one variant.

Annotations#

destructiveHint
true
idempotentHint
false
openWorldHint
false
readOnlyHint
false

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": {
"script": {
"maxLength": 65536,
"pattern": "^[^\\u0000]*$",
"type": "string"
},
"stderr_limit": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"stdout_limit": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
}
},
"required": [
"target",
"script"
],
"type": "object"
}
Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"properties": {
"authorization": {
"additionalProperties": false,
"properties": {
"enrollment_generation": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"pane_id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"process_generation": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"run_id": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"script_digest": {
"maxLength": 64,
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"server_generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"state": {
"const": "authorized"
}
},
"required": [
"state",
"run_id",
"script_digest",
"server_generation",
"pane_id",
"enrollment_generation",
"process_generation"
],
"type": "object"
},
"completion": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"exit_status": {
"maximum": 255,
"minimum": 0,
"type": "integer"
},
"signal": {
"type": "null"
},
"state": {
"const": "exited"
}
},
"required": [
"state",
"exit_status",
"signal"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"exit_status": {
"type": "null"
},
"signal": {
"maximum": 255,
"minimum": 1,
"type": "integer"
},
"state": {
"const": "signaled"
}
},
"required": [
"state",
"exit_status",
"signal"
],
"type": "object"
}
]
},
"stderr": {
"additionalProperties": false,
"properties": {
"bytes": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"data": {
"maxLength": 349528,
"type": "string"
},
"encoding": {
"enum": [
"utf-8",
"base64"
]
},
"truncated": {
"const": false
}
},
"required": [
"encoding",
"data",
"bytes",
"truncated"
],
"type": "object"
},
"stdout": {
"additionalProperties": false,
"properties": {
"bytes": {
"maximum": 262144,
"minimum": 0,
"type": "integer"
},
"data": {
"maxLength": 349528,
"type": "string"
},
"encoding": {
"enum": [
"utf-8",
"base64"
]
},
"truncated": {
"const": false
}
},
"required": [
"encoding",
"data",
"bytes",
"truncated"
],
"type": "object"
},
"target": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"kind": {
"const": "pane"
}
},
"required": [
"generation",
"kind",
"id"
],
"type": "object"
}
]
}
},
"required": [
"target",
"authorization",
"completion",
"stdout",
"stderr"
],
"type": "object"
},
"ok": {
"const": true
}
},
"required": [
"ok",
"data"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"error": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"delivery": {
"enum": [
"not_sent",
"possibly_sent",
"observed"
]
},
"effects": {
"additionalProperties": false,
"properties": {
"authorization": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"enrollment_generation": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"pane_id": {
"maxLength": 32,
"pattern": "^%[0-9]+$",
"type": "string"
},
"process_generation": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"run_id": {
"maxLength": 32,
"pattern": "^[a-f0-9]{32}$",
"type": "string"
},
"script_digest": {
"maxLength": 64,
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"server_generation": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"state": {
"const": "authorized"
}
},
"required": [
"state",
"run_id",
"script_digest",
"server_generation",
"pane_id",
"enrollment_generation",
"process_generation"
],
"type": "object"
},
{
"type": "null"
}
]
},
"completion": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"state": {
"const": "unobserved"
}
},
"required": [
"state"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"exit_status": {
"maximum": 255,
"minimum": 0,
"type": "integer"
},
"signal": {
"type": "null"
},
"state": {
"const": "exited"
}
},
"required": [
"state",
"exit_status",
"signal"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"exit_status": {
"type": "null"
},
"signal": {
"maximum": 255,
"minimum": 1,
"type": "integer"
},
"state": {
"const": "signaled"
}
},
"required": [
"state",
"exit_status",
"signal"
],
"type": "object"
}
]
},
"state": {
"enum": [
"none",
"known",
"unknown"
]
}
},
"required": [
"state",
"authorization",
"completion"
],
"type": "object"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message",
"delivery"
],
"type": "object"
},
"ok": {
"const": false
}
},
"required": [
"ok",
"error"
],
"type": "object"
}
],
"type": "object"
}
Esc

Type to search.

Reference preview Open reference