Skip to main content
Glama
doucej

playwright-mcp-server

by doucej

get_text

Extract visible text from the first web page element that matches a given CSS or XPath selector.

Instructions

Return the visible text content of the first element matching the selector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS or XPath selector.
Behavior3/5

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

With no annotations, the description carries the transparency burden. It adds useful behavioral nuance: 'visible' text (not hidden) and 'first element' (not all matches). However, it does not disclose what happens when no element matches, whether it waits for the element, or the exact return value when no match occurs.

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?

The description is a single, concise sentence that is front-loaded with the action and use case. No filler words, and every part earns its place.

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?

For a simple tool with one parameter and no output schema, the description covers both the input (selector) and the return value (visible text). It omits error behavior, but given the low complexity and sibling context, this is acceptable.

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?

The schema already fully describes the single parameter with 100% coverage, so the baseline is 3. The description adds no further semantic detail about the selector (e.g., how it is used), merely restating that the element must 'match the selector.'

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 the action ('Return'), the resource ('visible text content'), and the scope ('first element matching the selector'). This distinguishes it from sibling tools like get_html (returns HTML) and get_attribute (returns an attribute value).

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?

No guidance is given about when to use this tool versus alternatives such as get_html or get_attribute. It only implies its use for visible text, but it does not explicitly state exclusions or compare with siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/doucej/playwright-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server