Skip to main content
Glama
cploujoux

Puppeteer MCP Server

by cploujoux

puppeteer_fill

Automate input field filling on web pages using a CSS selector and specified value. Part of the Puppeteer MCP Server for browser automation tasks.

Instructions

Fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • The switch case implementing the puppeteer_fill tool. It waits for the selector, types the value into the input field using Puppeteer's page.type method, and returns success or error content.
    case "puppeteer_fill":
      try {
        await page.waitForSelector(args.selector);
        await page.type(args.selector, args.value);
        return {
          content: [
            {
              type: "text",
              text: `Filled ${args.selector} with: ${args.value}`,
            },
          ],
          isError: false,
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to fill ${args.selector}: ${
                (error as Error).message
              }`,
            },
          ],
          isError: true,
        };
      }
  • Tool registration in the TOOLS array, defining the name, description, and input schema (selector and value required) for puppeteer_fill.
    {
      name: "puppeteer_fill",
      description: "Fill out an input field",
      inputSchema: {
        type: "object",
        properties: {
          selector: {
            type: "string",
            description: "CSS selector for input field",
          },
          value: { type: "string", description: "Value to fill" },
        },
        required: ["selector", "value"],
      },
    },
  • index.ts:459-461 (registration)
    Registration of all tools including puppeteer_fill via the ListToolsRequestSchema handler returning the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));

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?

The description does not disclose behavioral traits such as whether the field is cleared before filling, whether events are triggered, or what happens if the selector is invalid. With no annotations, the description carries the full burden but fails to provide any behavioral context.

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 sentence that is front-loaded and concise. However, it could be slightly improved by adding more context without losing brevity.

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?

Given the simplicity of the tool (fill input field), the description is minimally adequate. However, the lack of output schema and behavioral details (e.g., does it clear existing values?) leaves gaps for the agent.

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%, with both 'selector' and 'value' having descriptions. The description adds no additional meaning beyond what the schema provides, so baseline 3 is appropriate.

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?

Description states 'Fill out an input field' which clearly identifies the action (fill) and resource (input field). However, it does not differentiate from sibling tools like puppeteer_select or puppeteer_click, which could also interact with input fields.

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 provided on when to use this tool versus alternatives like puppeteer_select or puppeteer_click. The description does not mention prerequisites, exclusions, or typical use cases.

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

Deploy Server

Other Tools

Related Tools