Skip to main content
Glama

playwright_iframe_fill

Fill form elements within iframes using CSS selectors to automate interactions with embedded content in web pages.

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

  • IframeFillTool class that implements the core logic for the 'playwright_iframe_fill' tool using Playwright's frameLocator to locate the iframe and fill the specified element with the given 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}`, ); }); } }
  • Tool schema definition including name, description, and input schema for validating arguments: iframeSelector, selector, and value.
    { 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"], }, },
  • Registration in the main tool handler switch statement that routes calls to 'playwright_iframe_fill' to the IframeFillTool instance's execute method.
    case "playwright_iframe_fill": return await iframeFillTool.execute(args, context);
  • Instantiation of the IframeFillTool instance used for handling the tool calls.
    if (!iframeFillTool) iframeFillTool = new IframeFillTool(server);
  • Import of IframeFillTool from the interaction module.
    IframeFillTool,

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

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