ctx_expand
Retrieve a specific slice of stored command output by handle—regex matches with context, line ranges, or tail—to inspect only relevant log lines and stay within a token budget.
Instructions
Fetch part of a stored ctx_run output by handle: lines matching a regex (grep, optional context), a line range (start/end), or the tail.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"handle": "<handle>"
},
"name": "ctx_expand"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Last line of a range (inclusive). | |
| grep | No | Regular expression (case-insensitive); returns matching lines with line numbers. | |
| tail | No | The last N lines. | |
| start | No | First line of a range (1-based). | |
| handle | Yes | The handle ctx_run printed, e.g. "r3". | |
| context | No | Lines of context around each grep match. | |
| budget_tokens | No | Hard cap on the tokens returned (estimate; default 2000). |