Skip to main content
Glama
puppeteer-mcp-claude

puppeteer-mcp-claude

by jaenster

puppeteer_get_text

Extracts the textContent of the first element matching a CSS selector on a Puppeteer-controlled page, enabling precise text retrieval from web pages.

Instructions

Get the textContent of the first element matching the selector.

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

Input Schema

NameRequiredDescriptionDefault
pageIdNo
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

C2.7/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 burden. It does disclose two useful traits: only the first match is read and only textContent is returned (not innerText or HTML). However, it says nothing about what happens when no element matches (error vs. empty), whether it auto-waits, or what the response shape is.

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?

A single front-loaded sentence with no filler; the key constraint ('first element matching') is placed where it is read. It is efficiently written, though the extreme brevity is part of why other dimensions are thin.

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?

For a tool with zero annotations, no output schema, and 0% schema description coverage, the description is too thin: it does not cover the pageId parameter, the no-match outcome, or waiting semantics. An agent could call it, but only by guessing on several points.

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 compensate. It clarifies selector semantics (first match) but adds nothing about what selector syntax is supported, and the pageId parameter is never mentioned at all — the agent cannot tell whether it is required, optional, or what its default/active-page behavior is.

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?

States a specific verb and resource ('Get the textContent') plus the exact extraction point ('first element matching the selector'), which is enough to distinguish it from puppeteer_evaluate or puppeteer_screenshot. It stops short of explicitly contrasting itself with any sibling, so it lands at 4 rather than 5.

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 guidance on when to reach for this versus puppeteer_evaluate or puppeteer_wait_for_selector, and no mention of whether the element must already be present or whether the call waits. The agent is left to infer all preconditions and alternatives.

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