playwright_fill
Fill input fields in web browsers using CSS selectors to automate form completion and data entry tasks with Playwright automation.
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
- src/tools/browser/interaction.ts:98-109 (handler)The FillTool class that provides the core handler implementation for the 'playwright_fill' tool. It waits for the selector and fills the input with the provided value using Playwright's page.fill method.export class FillTool extends BrowserToolBase { /** * Execute the fill tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.waitForSelector(args.selector); await page.fill(args.selector, args.value); return createSuccessResponse(`Filled ${args.selector} with: ${args.value}`); }); } }
- src/tools.ts:160-170 (schema)The tool schema definition for 'playwright_fill', including name, description, and input schema specifying required 'selector' and 'value' parameters.name: "playwright_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/toolHandler.ts:594-595 (registration)The registration and dispatch point in the main tool handler switch statement, which calls the FillTool's execute method for 'playwright_fill'.case "playwright_fill": return await fillTool.execute(args, context);
- src/toolHandler.ts:395-395 (registration)Instantiation of the FillTool instance used for handling 'playwright_fill' tool calls.if (!fillTool) fillTool = new FillTool(server);
- src/toolHandler.ts:25-25 (registration)Import declaration for the FillTool class from the interaction module.FillTool,