puppeteer_fill
Fill an input field by specifying a CSS selector and value for automated form interaction.
Instructions
Fill out an input field
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for input field | |
| value | Yes | Value to fill |
Implementation Reference
- src/tools/handlers.ts:161-180 (handler)Handler for puppeteer_fill: waits for the selector, then types the value into the input field.
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, }; } - src/tools/definitions.ts:59-69 (schema)Schema definition for puppeteer_fill tool: declares the name, description, and input schema requiring 'selector' and 'value'.
{ 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"], }, - src/server.ts:35-41 (registration)Registration in server.ts: exposes the TOOLS array via ListToolsRequestSchema and dispatches CallToolRequestSchema to handleToolCall, which routes to the puppeteer_fill case.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}, state, server) );