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);

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