puppeteer_fill
Automatically populate web form fields using CSS selectors to input specified values for browser automation tasks.
Instructions
Fill out an input field
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"selector": "<selector>",
"value": "<value>"
},
"name": "puppeteer_fill"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for input field | |
| value | Yes | Value to fill |
Implementation Reference
- index.ts:232-251 (handler)The handler logic for the puppeteer_fill tool. Waits for the selector, types the value into the input field, and returns a success or error message.
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:55-66 (schema)Input schema definition for the puppeteer_fill tool, specifying selector and value parameters.
{ 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:410-412 (registration)Registration of the tools list handler, which exposes the puppeteer_fill tool via the TOOLS array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); - index.ts:414-416 (registration)Registration of the call tool handler, which dispatches to the specific puppeteer_fill implementation in handleToolCall.
server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) );