Grep Text
grep_textSearch page text with a regex pattern to find matches and return each match with surrounding context and line number, avoiding full text extraction.
Instructions
Regex-hunt page text. Cheaper than extract_text+scan. Returns [{match,context,line}].
Ex: grep_text('t0', 'API_KEY=\w+') → {"_untrusted":true,"matches":[{"match":"API_KEY=abc","context":"...","line":42}]}
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": {
"tab_id": "<tab_id>",
"pattern": "<pattern>"
},
"name": "grep_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | Yes | ||
| pattern | Yes | ||
| selector | No | body | |
| max_matches | No | ||
| context_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||