text_around
Retrieve cleaned text around an element or matched text, returning before, match, and after content to provide page context.
Instructions
Return cleaned surrounding text around an element ref or the best ranked text match. Returns {ref, before, match, after, text}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "text_around"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional element ref like e:142 | |
| text | No | Optional text to locate when ref is omitted | |
| selector | No | Optional CSS selector to scope context | |
| context_chars | No | Characters before/after the target (default 400) |