Skip to main content
Glama

browser_text

Extract visible text from a web page or a CSS-selected element, excluding scripts, styles, and hidden nodes, with an optional character limit and truncation flag.

Instructions

Return the visible text (innerText) of the page or of the first element matching a CSS selector — no script/style bodies, no hidden nodes. Capped at maxChars (default 20000; truncated:true when cut).

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_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxCharsNoCap on returned text (default 20000)
selectorNoOptional CSS selector

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.5.0
    • addedInput schema / properties / maxChars
      Added value: +{
      +  "description": "Cap on returned text (default 20000)",
      +  "type": "number"
      +}
  2. First observedv2.0.4

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses innerText semantics, that script/style and hidden nodes are excluded, the default cap of 20000 chars, and that a `truncated:true` marker appears when cut. Gaps remain around what happens when the selector matches nothing and whether the page must be fully loaded, which for a mutation-free read tool are modest.

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

Conciseness5/5

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

One sentence with two tight parentheticals, front-loaded with the core action and immediately followed by the scoping exclusions. No filler, no redundancy with the schema beyond a harmless restatement of the default.

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

Completeness4/5

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

For a two-optional-parameter read tool with no output schema and no annotations, the description covers the essential return shape (text, truncation flag) and filtering semantics. Only the no-match / page-not-loaded edge cases are absent, which is a minor omission for this complexity level.

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 coverage is 100%, so both parameters are already documented in the schema; the baseline is 3. The description does add some meaning beyond it — 'first element matching' clarifies multi-match behavior and the `truncated:true` flag explains the consequence of `maxChars` — but it does not explain selector syntax or error behavior on no match.

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 gives a specific verb and resource ('Return the visible text (`innerText`) of the page or of the first element matching a CSS selector') and implicitly separates itself from HTML/snapshot siblings by emphasizing *visible* text. It never names a sibling or states an explicit contrast, so an agent must infer the boundary with browser_html or browser_snapshot.

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

Usage Guidelines3/5

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

Usage is only implied: 'visible text ... no script/style bodies, no hidden nodes' suggests when this is preferable to a raw HTML dump, but there is no explicit 'use this when / use X instead' statement. No prerequisites (page loaded, navigation first) or exclusion cases are given.

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