Skip to main content
Glama
afshawnlotfi

Configurable Puppeteer MCP Server

by afshawnlotfi

puppeteer_click

Automate browser interactions by clicking elements on web pages using CSS selectors for precise control in Puppeteer-based automation workflows.

Instructions

Click an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to click

Implementation Reference

  • Handler function for the puppeteer_click tool. Clicks the element specified by the CSS selector and returns success or error message.
    case "puppeteer_click":
      try {
        await page.click(args.selector);
        return {
          content: [{
            type: "text",
            text: `Clicked: ${args.selector}`,
          }],
          isError: false,
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Failed to click ${args.selector}: ${(error as Error).message}`,
          }],
          isError: true,
        };
      }
  • Tool schema definition including name, description, and input schema requiring a 'selector' property.
    {
      name: "puppeteer_click",
      description: "Click an element on the page",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string", description: "CSS selector for element to click" },
        },
        required: ["selector"],
      },
    },
  • index.ts:410-412 (registration)
    Registration of all tools including puppeteer_click via the ListToolsRequestHandler returning the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.4/5.0
Behavior1/5

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

The description is a tautology of the name and adds no behavioral details beyond 'click'. It does not specify side effects (e.g., navigation trigger), waiting behavior, or error conditions. With no annotations, this is insufficient for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (one sentence) but lacks necessary detail. It is front-loaded but does not earn its place by providing substantive information beyond the tool name.

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

Completeness1/5

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

Given the tool's simplicity (one parameter, no output schema), the description fails to cover essential context like post-click behavior, return value, or error handling. For a click action, crucial details (e.g., navigation wait) are missing.

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 input schema already describes the selector parameter (CSS selector for element to click). The description adds no further meaning, but schema coverage is 100%, meeting the baseline. No extra value is provided.

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 clearly states the action ('click') and the target ('an element on the page'), making the purpose obvious. It distinguishes from sibling tools like fill, hover, or navigate, which have different actions.

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 provides no guidance on when to use this tool versus alternatives (e.g., puppeteer_hover or puppeteer_fill). It does not mention prerequisites or context, leaving the agent to infer usage.

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