Skip to main content
Glama

read_text

Extract visible text from the current browser page or a specific element using a CSS selector; returns null when no element matches.

Instructions

Return the visible text of the current page, or of the first element matching selector. null when no element matches.

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

Input Schema

NameRequiredDescriptionDefault
selectorNoCSS selector of one element; empty for the whole page.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.47-alpha
    • addedInput schema / properties / selector / description
      Added value: +"CSS selector of one element; empty for the whole page."
  2. First observedv0.1.46

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the burden but does disclose two useful behaviors: it returns only visible (rendered) text, and it returns `null` when nothing matches. It says nothing about waiting for load, scrolling, truncation, or permission/auth context, which matters for a browser-automation read.

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?

Two short sentences, no filler, with the primary behavior front-loaded and the edge case (null on no match) trailing. Every clause earns its place.

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?

An output schema exists, so return shape needn't be spelled out, and the single parameter is fully documented in the schema. What remains thin is the relationship to sibling read tools (read_html, snapshot), which an agent must infer.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds real meaning: only the FIRST element matching the selector is used. That resolves a genuine ambiguity in CSS-selector semantics that the schema does not state.

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?

States a specific verb ('Return') and resource ('visible text of the current page' or a selected element), which is precise enough to distinguish it from read_html and snapshot in practice. It never names those siblings explicitly, so the differentiation is left to inference.

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 implied rather than stated: 'visible text' suggests use when rendered text is wanted instead of markup, and the empty-selector default is covered by the schema. There is no explicit when-to-use/when-not or pointer to read_html/snapshot/evaluate as alternatives.

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