MCPAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

call_read_tools_batch

Call a serial batch of at most sixteen enabled inspect tools. One approval for this batch covers every enabled nested name; inner tools do not receive separate client approval. The complete JSON-RPC response line, including its request ID and newline, is capped at 1,000,000 bytes; truncated payloads and omitted bytes are explicit. Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted.

All Rust tools · JSON · Source

Arguments

on_error optional
`stop`, the default, ends at the first failed call; `continue` makes the rest.

Default: "stop".

operations required · array
The inspect calls to make, in order.

Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema
{
"$defs": {
"OnError": {
"enum": [
"stop",
"continue"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"on_error": {
"$ref": "#/$defs/OnError",
"default": "stop",
"description": "`stop`, the default, ends at the first failed call; `continue` makes\nthe rest."
},
"operations": {
"description": "The inspect calls to make, in order.",
"items": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"end": {
"description": "End at this line. Omit for the bottom of the screen.",
"format": "int32",
"type": [
"integer",
"null"
]
},
"history": {
"default": false,
"description": "Read the whole history rather than the visible screen.",
"type": "boolean"
},
"last_command": {
"default": false,
"description": "Return only the last command's output, when the shell marks its\nprompts.\n\nAnswers far less than the history, because it starts where the last\ncommand's output began. When the pane's shell does not mark its\nprompts -- fish does, bash and zsh do not -- this reports\n`marks: \"absent\"` and returns the visible screen instead.",
"type": "boolean"
},
"pane": {
"description": "The `%`-prefixed pane id.",
"type": "string"
},
"start": {
"description": "Start at this line. Zero is the top of the screen, negative is\nscrollback. Omit for the top of the screen, or of the scrollback with\n`history`.",
"format": "int32",
"type": [
"integer",
"null"
]
}
},
"required": [
"pane"
],
"type": "object"
},
"tool": {
"const": "capture_pane",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"cursor": {
"description": "The cursor from the previous call. Omit to start watching.",
"type": [
"string",
"null"
]
},
"pane": {
"description": "The `%`-prefixed pane to read.",
"type": "string"
}
},
"required": [
"pane"
],
"type": "object"
},
"tool": {
"const": "capture_since",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"corner": {
"description": "`top-left`, `top-right`, `bottom-left`, or `bottom-right`.",
"type": "string"
},
"window": {
"description": "The `@`-prefixed window id.",
"type": "string"
}
},
"required": [
"window",
"corner"
],
"type": "object"
},
"tool": {
"const": "find_pane_by_position",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"pane": {
"description": "The `%`-prefixed pane id, as `list_panes` reports it.",
"type": "string"
}
},
"required": [
"pane"
],
"type": "object"
},
"tool": {
"const": "get_pane_info",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {},
"type": "object"
},
"tool": {
"const": "get_server_info",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"session": {
"description": "The session, by `$`-prefixed id as `list_sessions` reports it, or by\nname.",
"type": "string"
}
},
"required": [
"session"
],
"type": "object"
},
"tool": {
"const": "get_session_info",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"names": {
"description": "tmux format variable names, such as `pane_current_path`.",
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
"type": "string"
},
"maxItems": 32,
"minItems": 1,
"type": "array"
},
"pane": {
"description": "The `%`-prefixed pane to read them against. Omit to let tmux pick\nits current pane.",
"type": [
"string",
"null"
]
}
},
"required": [
"names"
],
"type": "object"
},
"tool": {
"const": "get_tmux_variables",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"window": {
"description": "The `@`-prefixed window id, as `list_windows` reports it.",
"type": "string"
}
},
"required": [
"window"
],
"type": "object"
},
"tool": {
"const": "get_window_info",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {},
"type": "object"
},
"tool": {
"const": "list_panes",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {},
"type": "object"
},
"tool": {
"const": "list_sessions",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {},
"type": "object"
},
"tool": {
"const": "list_windows",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"history": {
"default": false,
"description": "Search scrollback as well as the visible screen.",
"type": "boolean"
},
"match_case": {
"default": false,
"description": "Match case. Off by default.",
"type": "boolean"
},
"pattern": {
"description": "The text to look for.",
"maxLength": 4096,
"type": "string"
},
"regex": {
"default": false,
"description": "Read the pattern as a regular expression rather than literal text.",
"type": "boolean"
},
"session": {
"description": "Only search panes in this session, by `$`-prefixed id or name. Omit\nfor every session.",
"type": [
"string",
"null"
]
},
"window": {
"description": "Only search panes in this window, by `@`-prefixed id. Omit for every\nwindow.",
"type": [
"string",
"null"
]
}
},
"required": [
"pattern"
],
"type": "object"
},
"tool": {
"const": "search_panes",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"session": {
"description": "The session whose environment to read, by `$`-prefixed id or name.\n\nOmit for the server's own.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"tool": {
"const": "show_environment",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"session": {
"description": "The session whose hooks to read, by `$`-prefixed id or name. Omit for\nthe server's own.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"tool": {
"const": "show_hooks",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"name": {
"description": "The option name, such as `history-limit` or a user option like `@theme`.",
"type": "string"
},
"scope": {
"anyOf": [
{
"enum": [
"server",
"global-session",
"global-window",
"session",
"window",
"pane"
],
"type": "string"
},
{
"type": "null"
}
],
"description": "Which tmux object the option belongs to.\n\nOne of `server`, `global-session`, `global-window`, `session`,\n`window`, or `pane`. Defaults to `global-session`, which is what\nsetting an option without a target means in tmux."
},
"target": {
"description": "The `$`, `@` or `%`-prefixed id, for the scopes that need one. Omit\nfor the others.",
"type": [
"string",
"null"
]
}
},
"required": [
"name"
],
"type": "object"
},
"tool": {
"const": "show_option",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"arguments": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "That tool's arguments.",
"properties": {
"history": {
"default": false,
"description": "Include scrollback rather than only the visible screen.",
"type": "boolean"
},
"max_lines": {
"description": "The most content lines to return, oldest dropped first.\n\nDefaults to the whole visible screen. The end of a pane is what says\nwhat just happened, so a limit keeps the end.",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"pane": {
"description": "The `%`-prefixed pane id.",
"type": "string"
}
},
"required": [
"pane"
],
"type": "object"
},
"tool": {
"const": "snapshot_pane",
"type": "string"
}
},
"required": [
"tool"
],
"type": "object"
}
]
},
"maxItems": 16,
"minItems": 1,
"type": "array"
}
},
"required": [
"operations"
],
"type": "object"
}
Output schema
{
"$defs": {
"BatchItem": {
"properties": {
"error": {
"anyOf": [
{
"$ref": "#/$defs/ErrorData"
},
{
"type": "null"
}
]
},
"index": {
"minimum": 0,
"type": "integer"
},
"result": true,
"resultTruncated": {
"type": "boolean"
},
"success": {
"type": "boolean"
},
"tool": {
"type": "string"
}
},
"required": [
"index",
"tool",
"success",
"resultTruncated"
],
"type": "object"
},
"ErrorCode": {
"description": "Standard JSON-RPC error codes used throughout the MCP protocol.\n\nThese codes follow the JSON-RPC 2.0 specification and provide\nstandardized error reporting across all MCP implementations.",
"format": "int32",
"type": "integer"
},
"ErrorData": {
"description": "Error information for JSON-RPC error responses.\n\nThis structure follows the JSON-RPC 2.0 specification for error reporting,\nproviding a standardized way to communicate errors between clients and servers.",
"properties": {
"code": {
"$ref": "#/$defs/ErrorCode",
"description": "The error type that occurred (using standard JSON-RPC error codes)"
},
"data": {
"description": "Additional information about the error. The value of this member is defined by the\nsender (e.g. detailed error information, nested errors etc.)."
},
"message": {
"description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"OnError": {
"enum": [
"stop",
"continue"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"failed": {
"minimum": 0,
"type": "integer"
},
"onError": {
"$ref": "#/$defs/OnError"
},
"results": {
"items": {
"$ref": "#/$defs/BatchItem"
},
"type": "array"
},
"stoppedAt": {
"minimum": 0,
"type": [
"integer",
"null"
]
},
"succeeded": {
"minimum": 0,
"type": "integer"
},
"truncated": {
"type": "boolean"
},
"truncatedBytes": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"results",
"succeeded",
"failed",
"truncated",
"truncatedBytes",
"onError"
],
"type": "object"
}
Tool annotations
{
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true,
"readOnlyHint": true,
"title": "Call Read Tools Batch"
}
Esc

Type to search.