read_page
Extract a page's rendered text or a tree of actionable elements with aria-ref tokens for clicking and typing. Limit to a region or paginate long output.
Instructions
Read the page as text, or as a map of what can be acted on.
mode="text" (default) returns the rendered text (innerText), not
HTML. links=true adds the page's visible links as {text, href}
— absolute, de-duplicated, at most 100 (tree lines carry their own href).
mode="tree" returns one line per visible thing you can act on —
links, buttons, inputs, selects, checkboxes, tabs, menu items — plus
headings::
aria-ref=e12 link "Pricing" -> /pricing
aria-ref=e15 button "Save"
aria-ref=e16 checkbox "Remember me" [checked]Pass the aria-ref=... token exactly as written as the selector of
click or type_text. It reaches what a text selector cannot name:
icon-only links, several links with the same text, elements inside open
shadow roots and iframes. A ref is good for the page it was read from and
only while its element stays; a region read (selector) replaces the
refs of the read before it. When a ref is rejected or matches nothing,
read the tree again. Elements on screen come first (in_viewport
counts them). Input values are never shown. refs: false means this
Playwright predates aria refs: lines then carry none, so address elements
with role=link[name="Pricing"] or text= selectors.
selector limits either mode to one region (first match); it returns
not_found at once when nothing matches. offset and max_chars
page through long output: total_chars is its full length,
truncated says more follows, next_offset is where to continue.
Tree pages hold whole lines, so a ref is never cut in half. Every call
reads the page as it is now, so pages read while it changes or scrolls
may not line up.
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": "read_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | text | |
| links | No | ||
| offset | No | ||
| selector | No | ||
| max_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||