Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_fill

Automate web form filling by specifying a CSS selector and input value using browser automation capabilities within the Playwright MCP Server.

Instructions

fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • FillTool class with execute method implementing the core logic of playwright_fill: waits for selector and fills the input field with the provided value using Playwright's page.fill().
    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}`); }); } }
  • Input schema definition for the playwright_fill tool, specifying 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"], }, },
  • Dispatch case in the main tool handler that routes playwright_fill calls to the FillTool.execute method.
    case "playwright_fill": return await fillTool.execute(args, context);
  • Instantiation of the FillTool instance used for handling playwright_fill.
    if (!fillTool) fillTool = new FillTool(server);
  • src/tools.ts:456-456 (registration)
    Inclusion of playwright_fill in the BROWSER_TOOLS array, which triggers browser context setup.
    "playwright_fill",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devskido/customed-playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server