Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_iframe_fill

Fill form fields or input elements located within iframes on web pages using CSS selectors to specify both the iframe and target element.

Instructions

Fill an element in an iframe on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iframeSelectorYesCSS selector for the iframe containing the element to fill
selectorYesCSS selector for the element to fill
valueYesValue to fill

Implementation Reference

  • Core handler implementation for 'playwright_iframe_fill'. Uses Playwright's frameLocator to target iframe and fill the specified selector with the provided value.
    export class IframeFillTool extends BrowserToolBase {
      /**
       * Execute the iframe fill tool
       */
      async execute(args: any, context: ToolContext): Promise<ToolResponse> {
        return this.safeExecute(context, async (page) => {
          const frame = page.frameLocator(args.iframeSelector);
          if (!frame) {
            return createErrorResponse(`Iframe not found: ${args.iframeSelector}`);
          }
          
          await frame.locator(args.selector).fill(args.value);
          return createSuccessResponse(`Filled element ${args.selector} inside iframe ${args.iframeSelector} with: ${args.value}`);
        });
      }
    }
  • MCP tool schema defining the name, description, and input parameters (iframeSelector, selector, value) for 'playwright_iframe_fill'.
    {
      name: "playwright_iframe_fill",
      description: "Fill an element in an iframe on the page",
      inputSchema: {
        type: "object",
        properties: {
          iframeSelector: { type: "string", description: "CSS selector for the iframe containing the element to fill" },
          selector: { type: "string", description: "CSS selector for the element to fill" },
          value: { type: "string", description: "Value to fill" },
        },
        required: ["iframeSelector", "selector", "value"],
      },
    },
  • Tool registration in the main switch dispatcher: maps 'playwright_iframe_fill' call to IframeFillTool.execute(). The tool instance is created earlier at line 323.
    case "playwright_iframe_fill":
      return await iframeFillTool.execute(args, context);
  • Tool name listed in BROWSER_TOOLS constant for categorization.
    "playwright_iframe_fill",
  • src/tools.ts:455-455 (registration)
    Tool name included in BROWSER_TOOLS array used for conditional browser launch.
    "playwright_iframe_fill",
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('fill') but doesn't disclose behavioral traits such as whether this is a mutation (likely yes), error handling (e.g., if selectors fail), side effects, or response format. This leaves significant gaps for a tool with potential UI interactions.

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 sentence that directly states the tool's function without unnecessary words. It's front-loaded and appropriately sized for its purpose, with zero waste.

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 no annotations, no output schema, and a tool that likely performs UI mutations (filling elements), the description is incomplete. It lacks details on behavior, error cases, or return values, making it inadequate for safe and effective use by an AI agent in a complex context like Playwright automation.

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 descriptions for all three parameters (iframeSelector, selector, value). The description adds no additional meaning beyond the schema, such as examples or constraints, but the schema provides adequate baseline documentation.

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 clearly states the action ('fill') and target ('an element in an iframe on the page'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'playwright_fill' (which fills elements not in iframes) or 'playwright_iframe_click' (which clicks rather than fills), missing full sibling distinction.

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_fill' for non-iframe elements or other iframe-related tools. There's no mention of prerequisites (e.g., needing an iframe context) or exclusions, leaving usage context implied at best.

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