Skip to main content
Glama
Playwright MCP Server

Playwright MCP Server

by sohitmahato

playwright_extract_text

Extracts text content from web page elements using a CSS selector, optionally gathering text from all matching elements.

Instructions

Extract text content from elements

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

Input Schema

NameRequiredDescriptionDefault
multipleNoExtract from all matching elements
selectorYesCSS selector of element(s)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

Because no annotations are provided, the description has to carry the full behavioral burden. It does not explain whether hidden elements are included, whether the text is trimmed or concatenated, what happens when nothing matches the selector, or whether the call throws an error. It also does not say whether the call waits for the element.

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 five-word phrase that is fully front-loaded, with no filler. Its weakness is under-specification rather than verbosity, which is penalized in the other dimensions.

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?

The tool is simple and its schema is fully annotated, so the description needs to cover only a little. The notable gap is return semantics: with no output schema, the description could say that a single string is returned and that with multiple=true an array is returned. Instead, it leaves this to inference.

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%, and both parameters (selector and multiple) are documented in the input schema. The description adds no meaning beyond that; in particular, the word 'elements' only faintly hints at the multiple behavior. Therefore, the baseline score of 3 applies.

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 names a specific verb and resource: 'Extract text content from elements.' That is enough for an agent to distinguish it from action-oriented siblings like playwright_click or playwright_fill. It does not, however, distinguish it from neighbors that also read DOM state, such as playwright_get_attribute or playwright_get_page_info.

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 contains no guidance about when to reach for this tool instead of playwright_get_attribute, playwright_evaluate, or playwright_get_page_info. It also says nothing about prerequisites, such as whether the page must have navigated or whether the selector has to exist.

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