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/callSendsearch_panesas the tool name, with the arguments below.
Arguments#
-
Search scrollback as well as the visible screen.
-
match_case? =false(boolean) #Match case. Off by default.
-
The text to look for.
- maxLength
4096
-
Read the pattern as a regular expression rather than literal text.
-
Only search panes in this session, by
$-prefixed id or name. Omit for every session. -
Only search panes in this window, by
@-prefixed id. Omit for every window.
No other arguments are accepted.
Result#
Returns object
Types#
Annotations#
destructiveHintfalseidempotentHinttrueopenWorldHinttruereadOnlyHinttruetitle"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"}