Skip to main content
Glama

puppeteer_fill

Automatically populate web form fields using CSS selectors to input specified values in browser automation workflows.

Instructions

Fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • Handler for the 'puppeteer_fill' tool. Waits for the CSS selector of the input field, types the provided value into it, and returns a success or error response.
    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.message}`,
          }],
          isError: true,
        };
      }
  • index.ts:139-150 (registration)
    Registration of the 'puppeteer_fill' tool in the TOOLS array used for listing available tools. Includes name, description, and input schema.
    {
      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:451-451 (registration)
    Registration of the handleToolCall function as the handler for CallToolRequestSchema, which dispatches to specific tool cases including puppeteer_fill.
    server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}));
  • index.ts:447-448 (registration)
    Handler for ListToolsRequestSchema that returns the TOOLS array containing the puppeteer_fill tool registration.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('fill out') but doesn't describe what this entails—e.g., whether it simulates typing, triggers events, requires the element to be visible, or has side effects. This leaves significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is a single, direct sentence with no wasted words, making it highly concise and front-loaded. Every word contributes to stating the tool's purpose efficiently.

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?

Given the complexity of a browser automation tool with no annotations and no output schema, the description is inadequate. It lacks details on behavior, error handling, or return values, failing to compensate for the missing structured data.

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 has 100% description coverage, with clear documentation for both parameters (selector and value). The description adds no additional meaning beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage.

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 ('fill out') and target ('an input field'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like puppeteer_click or puppeteer_select, which also interact with page elements, so it doesn't reach the highest score.

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. It doesn't mention prerequisites (e.g., needing a page loaded), exclusions, or comparisons to sibling tools like puppeteer_select for dropdowns, leaving usage context implied but unspecified.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/MCP-Puppeteer-Linux'

If you have feedback or need assistance with the MCP directory API, please join our Discord server