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

search_panes

Search what panes are displaying with Rust’s linear-time regex engine. Accept at most 4,096 pattern bytes; search at most 64 panes, 8,192 lines, and 1 MiB; spend at most 250 ms matching and five seconds capturing. Report the pane and line of every match. Use this to find where something is — which pane has the failing test, which one printed the error — instead of capturing panes one at a time. Searches the visible screen by default; set history to include scrollback. Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted.

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

Arguments#

  • history? = false (boolean) #

    Search scrollback as well as the visible screen.

  • match_case? = false (boolean) #

    Match case. Off by default.

  • pattern (string) #

    The text to look for.

    maxLength
    4096
  • regex? = false (boolean) #

    Read the pattern as a regular expression rather than literal text.

  • session? (string | null) #

    Only search panes in this session, by $-prefixed id or name. Omit for every session.

  • window? (string | null) #

    Only search panes in this window, by @-prefixed id. Omit for every window.

No other arguments are accepted.

Result#

Returns object

Types#

MatchView: object

type

One line of one pane that matched a search.

Annotations#

destructiveHint
false
idempotentHint
true
openWorldHint
true
readOnlyHint
true
title
"Search Pane Contents"

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": {
"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"
}
Output schema
{
"$defs": {
"MatchView": {
"description": "One line of one pane that matched a search.",
"properties": {
"line": {
"description": "Which line of the capture matched, counting from the top.",
"minimum": 0,
"type": "integer"
},
"pane": {
"description": "The pane the line was found in.",
"type": "string"
},
"text": {
"description": "The line itself.",
"type": "string"
},
"window_id": {
"description": "The window that pane belongs to.",
"type": "string"
}
},
"required": [
"pane",
"window_id",
"line",
"text"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"capped": {
"description": "Whether the match ceiling was reached, so there may be more.",
"type": "boolean"
},
"matches": {
"description": "Every matching line, in the order the panes were read.",
"items": {
"$ref": "#/$defs/MatchView"
},
"type": "array"
},
"panes_searched": {
"description": "How many panes were read to answer this.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"matches",
"panes_searched",
"capped"
],
"type": "object"
}
Esc

Type to search.

Reference previewOpen reference