Skip to main content
Glama

playwright_iframe_fill

Fill elements within iframes on web pages using CSS selectors and specified values, enabling precise browser automation in Playwright.

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

  • Implementation of the IframeFillTool class which contains the execute method handling the playwright_iframe_fill tool logic using Playwright frameLocator and fill.
    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}`);
        });
      }
    }
  • Tool schema definition including name, description, and input schema for validation.
      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"],
      },
    },
  • Switch case in handleToolCall that registers and dispatches to the IframeFillTool handler.
    case "playwright_iframe_fill":
      return await iframeFillTool.execute(args, context);
  • src/tools.ts:455-455 (registration)
    Inclusion in BROWSER_TOOLS array for conditional browser launch.
    "playwright_iframe_fill",
  • Instantiation of the IframeFillTool instance in initializeTools.
    if (!iframeFillTool) iframeFillTool = new IframeFillTool(server);
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 states the action ('fill') but doesn't explain what 'fill' entails (e.g., typing text, clearing existing content, triggering events), potential side effects (e.g., page reloads, validation), error conditions, or performance implications. This leaves significant gaps for a mutation tool.

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, direct sentence with no wasted words. It front-loads the core action and context efficiently, making it easy to parse and understand immediately.

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 incomplete. It lacks details on behavior (e.g., how filling works, error handling), usage context (e.g., when to apply), and output expectations. While the schema covers parameters well, the overall context for safe and effective use is insufficient.

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 parameter semantics beyond what the schema provides, such as examples or constraints. Since the schema is comprehensive, the baseline score of 3 is appropriate.

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'), which is specific and unambiguous. It distinguishes itself from sibling tools like 'playwright_fill' by specifying the iframe context, though it doesn't explicitly mention how it differs from other iframe-related tools like 'playwright_iframe_click'.

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. It doesn't mention when to choose this over 'playwright_fill' (for non-iframe elements) or 'playwright_iframe_click' (for clicking instead of filling), nor does it specify prerequisites like requiring the iframe to be accessible or the page to be loaded.

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/executeautomation/mcp-playwright'

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