Skip to main content
Glama

Get page or element text

browser_get_text
Read-only

Extract 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

NameRequiredDescriptionDefault
refNoOptional element ref from browser_snapshot.
tabIdNoControlled tab id.
maxCharsNoMaximum characters to return (default 20000).
selectorNoOptional CSS selector.
attributeNoOptional attribute name to read instead of text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds one genuine behavioral detail: only *visible* text is returned (implying hidden elements are skipped), and that an attribute can be read instead of text. It does not disclose truncation behavior, precedence between ref and selector, or what happens with no arguments, though some of that lives in the schema.

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?

A single front-loaded sentence with no filler, and the two key modes are stated up front. It is efficient, though the terseness is partly the source of the definition's gaps rather than a virtue of careful compression.

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?

Five optional parameters with no required fields, no output schema, and two independent element-selection mechanisms (ref vs selector) whose interaction is never explained. For a tool where calling it with zero arguments is legal and produces a whole-page dump, the description should state defaults and selection precedence but says nothing.

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

Parameters3/5

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

Schema description coverage is 100%, so the parameters (ref, tabId, maxChars, selector, attribute) are already fully documented with a default for maxChars. The description corroborates the element-vs-page and text-vs-attribute choices but adds no syntax, precedence, or format meaning beyond the schema. Baseline 3 applies.

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 names a specific verb ("Extract") and resource ("visible text ... from a target element or the entire page"), plus the attribute variant. An agent can tell this reads content rather than visual state, distinguishing it from browser_screenshot and browser_snapshot, though neither sibling is named explicitly.

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?

No when-to-use or when-not-to-use guidance is given. The phrase "a target element or the entire page" implies two modes but never states which to choose or how this relates to browser_snapshot, which the ref parameter implies is a companion/predecessor. The agent must infer the workflow from the schema's mention of browser_snapshot.

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