Skip to main content
Glama

Get text

browser_get_text
Read-only

Extract visible text from a page or specific element, with optional scoping, redaction, and character limits. Use it to read UI content and verify page state.

Instructions

Visible text of an element or the page (redacted, truncated to maxChars).

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

NameRequiredDescriptionDefault
nthNo
refNoElement ref from snapshot (preferred)
nameNo
roleNo
textNo
exactNo
labelNo
pageIdNo
testIdNo
withinNoScope to a unique container (ref, role+name, label, testId or CSS selector)
sessionNo
maxCharsNo
selectorNoCSS (last resort)
placeholderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds genuinely new behavior: output is redacted and truncated at maxChars, which an agent could not learn from annotations. It does not explain what redaction removes or what the returned text looks like when an element is not found, so it stops short of full disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One tightly written sentence with the behavioral caveats (redacted, truncated) front-loaded in parentheses. Nothing is wasted, though the extreme brevity leaves too little room for locator-strategy guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter, nested-object locator tool with no output schema, a single sentence is not enough. An agent cannot determine which locator to supply, how duplicates are resolved via `nth` or `exact`, or how `within` scoping behaves, all of which are required to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 14 parameters at 21% schema description coverage, the description must compensate and does not: it explains only maxChars. The locator precedence (ref preferred), the mutual exclusivity of role/name/text/label/placeholder/testId/selector, the meaning of `nth`, `exact`, `within` scoping, and `pageId`/`session` targeting are all left undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a concrete verb+resource: retrieve the visible text of a specific element or of the whole page. That distinguishes it reasonably well from browser_get_attributes (attributes rather than text) and browser_screenshot, though it never names those siblings. The parenthetical about redaction and truncation sharpens the scope further.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use guidance: nothing says to call browser_snapshot first to obtain a `ref`, or to prefer browser_get_attributes when attribute values are needed. The only implied guidance is 'element or the page', which an agent must infer from the optional targeting parameters. No exclusions or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.