Skip to main content
Glama

ui_get_text

ui_get_text

Read the visible text of a selected element or whole page to verify displayed content such as table values, headings, field errors, or totals.

Instructions

Read the trimmed visible text of the single element matching the selector, or of the whole page body when no selector is given (cut at 4000 characters with a note of the real length). Use it to check content: a table value, a heading, an error under a field, a total. Fails if the selector matches no element, more than one, or an element that is not visible. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them.

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

Input Schema

NameRequiredDescriptionDefault
selectorNoCSS selector, or the `selector` value of an element from ui_get_page_state, passed unchanged; omit to read the whole page body
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/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 well: it discloses the 4000-character truncation with a reported real length, the three failure modes (no match, multiple matches, invisible element), and the positional-selector staleness caveat. It omits only return-format specifics such as whitespace normalization behavior.

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?

Front-loaded with scope, then usage examples, then failure modes, then the positioning caveat. Every sentence contributes a distinct fact with no restatement of the tool name.

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

Completeness5/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 scope, truncation limits, failure modes, and selector-reuse gotchas — everything an agent needs to call it correctly and interpret the result.

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 is 3, but the description adds real meaning: it clarifies that the selector must match exactly one element and introduces the 'nth=' positional behavior for reusing selectors, which the schema does not mention.

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?

Names a specific verb and resource ('Read the trimmed visible text') and states the two scopes precisely: the single matched element, or the whole page body when no selector is given. This is clearly distinct from siblings like ui_take_screenshot or ui_get_page_state.

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?

Gives concrete when-to-use examples ('a table value, a heading, an error under a field, a total') and states the failure conditions. It does not explicitly contrast with alternatives such as ui_assert or ui_check, so it falls short of a full routing rule.

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