Skip to main content
Glama

get_text

Read the text content of a specific page element by CSS selector. Use it to get one element's text without loading the entire page.

Instructions

Get the text content of a specific element. Returns the element's text. When to use: to read a specific element's text without reading the whole page. Related: read_page (read full page), get_attribute (read element attributes like href, src). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoOptional. Tab id this read targets. Omit when the calling agent owns exactly one tab; required to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this.
selectorYesCSS selector or element ref (e.g., "#price", ".title", or "e3" from get_dom_snapshot)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/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 burden and does substantial work: it discloses multi-agent tab scoping, the TAB_NOT_OWNED cross-agent rejection, and a configurable tab cap (default 8, range 1-64). What it omits is what happens when the selector matches nothing or multiple elements, which is a relevant failure mode for a read-by-selector tool.

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?

Purpose and return value are front-loaded in two short sentences, and the guidance blocks are compact. The 'cap configurable (default 8, 1-64)' fragment is terse to the point of ambiguity about what is capped, costing it a point.

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-parameter read tool with no output schema, the description covers purpose, return type, alternatives, and the tab-ownership constraint, which is most of what an agent needs. It stops short of describing empty/no-match behavior or whether the read waits for the element to appear.

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 both parameters are already documented in the schema, making 3 the baseline. The description restates the tab_id rule ('Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise') without adding format or edge-case detail beyond the schema text.

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

Purpose5/5

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

The description gives a specific verb+resource ('Get the text content of a specific element') and explicitly states the return ('Returns the element's text'). It also names the sibling tools it must be distinguished from (read_page, get_attribute) and the scope difference, so an agent can select it without opening any schema.

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

Usage Guidelines5/5

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

It has an explicit 'When to use' clause ('to read a specific element's text without reading the whole page') plus a 'Related' block that routes the agent to read_page for full-page reads and get_attribute for attribute reads. When-to-use, alternatives, and the selecting condition are all present.

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