Skip to main content
Glama

get_text

Extract visible text from a webpage or specific element using a CSS selector or ref. Supports iframes and specified tabs or frames to retrieve content for analysis.

Instructions

Get visible text of the page or an element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref from a snapshot
tabIdNoTab id (default: active tab)
frameIdNoFrame id from frames_list
maxBytesNoCap returned content at N UTF-8 bytes (default 262144); the full payload still lands in results/
selectorNoCSS selector (or pass ref)
allFramesNoAct on the first match in ANY frame (the element may be in an iframe)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.9.5
    • changedInput schema / properties / allFrames / description
      Previous value: -"Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)"New value: +"Act on the first match in ANY frame (the element may be in an iframe)"
    • changedInput schema / properties / frameId / description
      Previous value: -"Act inside this frame (ids come from frames_list)"New value: +"Frame id from frames_list"
    • changedInput schema / properties / maxBytes / description
      Previous value: -"Cap the returned content at this many UTF-8 bytes (default 262144). A truncated result reports truncated/totalBytes/returnedBytes. The full payload is still written to the task's results/ dir."New value: +"Cap returned content at N UTF-8 bytes (default 262144); the full payload still lands in results/"
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref from a prior read (exactly one of selector|ref)"New value: +"Element ref from a snapshot"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector (exactly one of selector|ref)"New value: +"CSS selector (or pass ref)"
    • changedInput schema / properties / tabId / description
      Previous value: -"Target tab id (defaults to the active tab)"New value: +"Tab id (default: active tab)"
  2. Changed3 schema fields changedv0.7.0
    • addedInput schema / properties / allFrames
      Added value: +{
      +  "description": "Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / frameId
      Added value: +{
      +  "description": "Act inside this frame (ids come from frames_list)",
      +  "type": "number"
      +}
    • addedInput schema / properties / maxBytes
      Added value: +{
      +  "description": "Cap the returned content at this many UTF-8 bytes (default 262144). A truncated result reports truncated/totalBytes/returnedBytes. The full payload is still written to the task's results/ dir.",
      +  "type": "number"
      +}
  3. First observedv0.6.2

TDQS

B3/5.0
Behavior2/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It only says 'visible text' without defining what counts as visible, how hidden or rendered text is handled, whether it returns plain text or formatted content, or any side effects. The behavior is underspecified.

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?

The description is a single concise sentence with no wasted words. It is front-loaded with the core purpose, though its brevity sacrifices necessary detail—this is more a completeness issue than a conciseness one.

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

Completeness1/5

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

Given six parameters, no output schema, and no annotations, the description is severely incomplete. It fails to explain how parameters like ref, selector, and allFrames interact, what the output format is, or when to prefer this over related tools. Agents lack essential context to call it correctly.

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 all six parameters are already documented in the schema with meaningful descriptions. The tool description adds no additional parameter semantics, so the baseline score of 3 applies.

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 clearly states a specific verb ('Get') and resource ('visible text of the page or an element'), which distinguishes it from siblings like get_html or read_as_markdown. It conveys the core function unambiguously.

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?

The description offers no guidance on when to use this tool versus alternatives such as get_html, read_as_markdown, or snapshot. There is no mention of context, exclusions, or criteria for selection, leaving the agent to infer usage from the name and schema alone.

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