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
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for input field | |
| value | Yes | Value to fill |
Implementation Reference
- index.ts:252-277 (handler)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, }; }
- index.ts:67-81 (schema)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, }));