Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_fill

Fill input fields on web pages using CSS selectors to automate form completion or data entry tasks in browser automation workflows.

Instructions

fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • The FillTool.execute method implements the core logic of the 'playwright_fill' tool. It waits for the specified selector to appear, then uses Playwright's page.fill() to input the value into the element.
    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}`);
        });
      }
    }
  • Tool schema definition for 'playwright_fill', specifying name, description, and input schema requiring '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"],
      },
    },
  • Registration of 'playwright_fill' in the main tool handler switch statement, dispatching execution to the FillTool instance.
    case "playwright_iframe_fill":
      return await iframeFillTool.execute(args, context);
      
    case "playwright_fill":
      return await fillTool.execute(args, context);
  • Import of FillTool from interaction.js, necessary for tool instantiation and execution.
    import {
      ClickTool,
      IframeClickTool,
      FillTool,
      SelectTool,
      HoverTool,
      EvaluateTool,
      IframeFillTool,
      UploadFileTool
    } from './tools/browser/interaction.js';
    import { 
  • 'playwright_fill' listed in BROWSER_TOOLS array, used for conditional browser launching.
    "playwright_iframe_fill",
    "playwright_fill",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. 'fill out an input field' implies a write operation but doesn't specify whether it requires the field to be visible/interactable, if it triggers events, or what happens on failure. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase ('fill out an input field') that directly conveys the core function without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, or behavioral nuances (e.g., waiting for the field to be ready). Given the complexity of browser automation, more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for both parameters ('selector' and 'value'). The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'fill out an input field' clearly states the action (fill) and target (input field), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'playwright_iframe_fill', which appears to serve a similar purpose for iframes, so it doesn't reach the highest score for sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'playwright_iframe_fill' or other input-related tools. It lacks context about prerequisites (e.g., needing an active page) or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/devskido/customed-playwright'

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