Skip to main content
Glama

get_text

Extracts the visible text from a web element using a CSS, XPath, ID, name, tag, class, or link selector, so you can verify or capture on-page content.

Instructions

Get the visible text content of an element.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "get_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoStrategycss
timeoutNoSeconds
selectorYesLocator value

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.3
    • changedInput schema / properties / by / description
      Previous value: -"Locator strategy"New value: +"Strategy"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector, XPath, or other locator value"New value: +"Locator value"
    • changedInput schema / properties / timeout / description
      Previous value: -"Wait timeout in seconds"New value: +"Seconds"
  2. First observedv0.3.7

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full disclosure burden and does not meet it. It does not say whether the call waits for the element (despite a timeout parameter), what happens on a missing/hidden element, whether text is trimmed or concatenated across descendants, or that it is a read-only DOM access.

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?

One sentence with zero waste, front-loaded with the verb and resource. Its brevity is efficient, though it shades into under-specification rather than pure tightness.

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

Completeness2/5

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

There is no output schema and no annotations, so the description is the only place to say what is returned (a string? all matched elements? whitespace handling?) and it does not. For a 3-parameter extraction tool with an implicit blocking behavior, this leaves key invocation details unstated.

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 the schema documents selector, by, and timeout adequately; baseline 3 applies. The description adds no meaning beyond the schema — notably it never connects the 'visible' qualifier to how it interacts with waiting or the timeout value.

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?

A specific verb ('Get') and resource ('visible text content of an element') make the operation unambiguous. However, it does nothing to separate itself from near-neighbors like get_attribute, inspect_page, or find_element, so the agent must infer the boundary itself.

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?

There is no statement of when to use this versus get_attribute, get_page_source, or inspect_page, nor any prerequisite context (an element/frame being present). The only guidance is the restated purpose.

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