Skip to main content
Glama

get_text

Extract visible text from a whole page or a CSS-selected element, excluding hidden text and collapsing whitespace.

Instructions

Return the visible text content of an element (or the whole page if no selector). Whitespace is collapsed; hidden text is excluded.

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": "get_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorNoCSS selector. Omit to read the whole page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description usefully conveys a read operation and discloses two important output behaviors: whitespace collapsing and exclusion of hidden text. It leaves edge cases unspecified, such as unmatched selectors, multiple matching elements, and frame scope.

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 front-load the operation and scope, then concisely describe text normalization and visibility. There is no redundant or promotional wording.

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?

This is sufficient for correctly invoking a simple read tool with one optional, fully documented parameter, and the returned content is clear despite the absence of an output schema. Explicit no-match and multi-match behavior, plus a pointer to get_html for markup, would make it more complete.

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%, and the schema already explains that selector is a CSS selector whose omission reads the whole page. The description repeats the omission behavior but adds no further detail about selector matching or invalid selectors, so the high-coverage baseline 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 clearly states the operation and resource: returning visible text from either a selected element or the whole page. “Visible text” implies a distinction from get_html, but it does not explicitly differentiate itself from that sibling or evaluate.

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

Usage Guidelines4/5

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

It gives clear usage contexts: supply a selector for an element or omit it for page-wide text extraction. It does not explicitly say when not to use it or direct agents to get_html when markup rather than rendered text is needed.

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