Get page or element text
browser_get_textExtract visible text or a specific attribute from a web page element or the entire page using a CSS selector or element reference, with optional character limits.
Instructions
Extract visible text (or a specific attribute) from a target element or the entire page.
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": "browser_get_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional element ref from browser_snapshot. | |
| tabId | No | Controlled tab id. | |
| maxChars | No | Maximum characters to return (default 20000). | |
| selector | No | Optional CSS selector. | |
| attribute | No | Optional attribute name to read instead of text. |