puppeteer_fill
Automate input field filling using CSS selectors and specified values for web interaction tasks on Linux-based browser automation systems.
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:280-300 (handler)The handler logic for the puppeteer_fill tool. It waits for the CSS selector to appear on the page, types the provided value into the input field using Puppeteer's page.type method, and returns a success message or an error if the operation fails.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 (schema)Defines the tool metadata including name, description, and input schema (requiring 'selector' and 'value' parameters) for puppeteer_fill, used for tool listing and validation.{ 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:447-449 (registration)Registers the list of available tools (including puppeteer_fill via the TOOLS array) with the MCP server through the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- index.ts:451-451 (registration)Registers the general tool call handler that dispatches to the specific puppeteer_fill case in handleToolCall based on the tool name.server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}));