Skip to main content
Glama
puppeteer-mcp-claude

puppeteer-mcp-claude

by jaenster

puppeteer_evaluate

Runs a JavaScript expression in the current page context and returns its JSON-serialized result, enabling browser-side data extraction or DOM checks.

Instructions

Run a JavaScript expression in the page context and return its JSON-serialised result.

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": {
      "script": "<script>"
    },
    "name": "puppeteer_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageIdNo
scriptYes

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 and omits key traits: arbitrary JS can mutate page state or trigger navigation, promises may or may not be awaited, non-serialisable results will fail, and error behavior is unstated. It only discloses that the return value is JSON-serialised, which is a single useful detail against several significant gaps for an arbitrary-code execution tool.

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 front-loaded sentence with zero filler; every word earns its place. The brevity is not the problem here — the missing information is, so this is efficient but not exemplary.

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 powerful arbitrary-code-execution tool with no annotations, no output schema, and undocumented parameters, the definition is far too thin. An agent cannot determine default page targeting, serialisation limits, await semantics, or side-effect risk from this description.

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 that script is evaluated as an expression and that the result is serialised, but pageId is entirely unexplained (which page? default active page?) and there is no detail on expression-vs-statement handling or multi-statement scripts.

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 ("Run") and resource ("a JavaScript expression in the page context") with the outcome stated (returns JSON-serialised result). It is clear what the tool does, but nothing distinguishes it from siblings such as puppeteer_get_text, which overlaps for read-only extraction.

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 gives no when-to-use or when-not-to-use guidance, no mention of preferring dedicated tools like puppeteer_click or puppeteer_get_text over arbitrary evaluation, and no prerequisites. The agent must infer its role in the toolset from the name alone.

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