Skip to main content
Glama
hrmeetsingh

MCP Browser Automation Server

by hrmeetsingh

playwright_fill

Automate browser tasks by filling input fields with specified values using CSS selectors, enabling streamlined interaction with web elements via the MCP Browser Automation Server.

Instructions

fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • Handler implementation for the playwright_fill tool. It waits for the selector to appear and then fills the input field with the provided value using Playwright's page.fill method.
    case "playwright_fill":
      try {
        await page!.waitForSelector(args.selector);
        await page!.fill(args.selector, args.value);
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Filled ${args.selector} with: ${args.value}`,
            }],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Failed to type ${args.selector}: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
  • Schema definition for the playwright_fill tool, specifying the input parameters selector and value.
    {
      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/index.ts:23-26 (registration)
    Registration of tools including playwright_fill via createToolDefinitions() and setupRequestHandlers.
    const TOOLS = createToolDefinitions();
    
    // Setup request handlers
    setupRequestHandlers(server, TOOLS);
  • Helper array BROWSER_TOOLS that includes playwright_fill, used to determine if browser launch is required.
    export const BROWSER_TOOLS = [
      "playwright_navigate",
      "playwright_screenshot",
      "playwright_click",
      "playwright_fill",
      "playwright_select",
      "playwright_hover",
      "playwright_evaluate"
    ];
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'fill out' but doesn't describe side effects (e.g., does it trigger events, require focus, or handle errors?), permissions, or performance aspects. This leaves the agent with insufficient information for safe and effective use.

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 with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

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?

Given the complexity of browser automation and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral traits, error handling, or interaction with sibling tools, leaving significant gaps for an agent to operate effectively in this context.

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?

Schema description coverage is 100%, with clear parameter descriptions in the schema (CSS selector and value). The description adds no additional meaning beyond the schema, such as examples or constraints. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'fill out an input field' states the basic action (verb: 'fill out', resource: 'input field'), but it's vague about scope and lacks differentiation from siblings like playwright_select or playwright_put. It doesn't specify whether this applies to forms, text areas, or other input types, making it minimally adequate but with clear gaps.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this is for text inputs only, how it differs from playwright_select for dropdowns, or prerequisites like needing a page to be loaded. The description offers no context for usage decisions.

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

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/hrmeetsingh/mcp-browser-automation'

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