Skip to main content
Glama

playwright_fill

Automatically populate an input field on a webpage by specifying its CSS selector and desired value, enabling precise browser automation through the MCP Playwright CDP server.

Instructions

fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • The main handler implementation for the 'playwright_fill' tool. It waits for the specified selector to appear on the page and then fills the input field with the provided value. Returns success or error message accordingly.
    case "playwright_fill": try { await page!.waitForSelector(args.selector); await page!.fill(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 type ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }

Other Tools

Related Tools

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/lars-hagen/mcp-playwright-cdp'

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