Skip to main content
Glama

text

Read-onlyIdempotent

Extracts the text content of the first element matching a CSS selector, enabling AI agents to verify page state during browser automation.

Instructions

[Agent Browser] Get the text content of an element. Returns the first matching element's textContent. Useful for verification.

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

Input Schema

NameRequiredDescriptionDefault
selectorYes

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds a useful trait — that only the first matching element's textContent is returned — but says nothing about what happens when no element matches (empty string vs error) or how this differs from the nth/relative variants.

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?

Three short sentences, front-loaded with the core action and result. The '[Agent Browser]' prefix and 'Useful for verification' are the only low-value bits; nothing else is padded.

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

Completeness3/5

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

An output schema exists, so return-shape explanation is unnecessary, and the tool is a simple single-parameter read. Still missing for correct invocation: selector syntax, no-match behavior, and routing away from assert_text/wait_for_text, which are the most likely miscall targets.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the meaning of 'selector', but it never states whether it is a CSS selector, XPath, or a test-id convention, nor whether hidden elements are matched. 'First matching element' only implies selectors can match multiple nodes without explaining the syntax.

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 gives a specific verb and resource ('Get the text content of an element') and clarifies the vague tool name 'text' by naming textContent as the return value. It does not differentiate from siblings such as assert_text or wait_for_text, which also target element text.

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?

'Useful for verification' is the only usage hint and is vague; it does not say when to read text with this tool versus using assert_text to verify it, nor does it mention preconditions such as waiting for the element to exist.

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