Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_iframe_fill

Fill specific elements within iframes using CSS selectors. Enables browser automation by targeting nested content, ensuring precise interaction with web page components via Playwright MCP Server.

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

  • The IframeFillTool class provides the core handler logic for the 'playwright_iframe_fill' tool. It uses 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}`); }); } }
  • The input schema definition for the 'playwright_iframe_fill' tool, specifying required parameters: 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 and dispatch in the main handleToolCall switch statement, routing calls to the IframeFillTool instance.
    case "playwright_iframe_fill": return await iframeFillTool.execute(args, context);
  • Instantiation of the IframeFillTool instance during tool initialization.
    if (!iframeClickTool) iframeClickTool = new IframeClickTool(server); if (!iframeFillTool) iframeFillTool = new IframeFillTool(server);
  • The tool name is listed in the BROWSER_TOOLS array for conditional browser launching.
    "playwright_iframe_fill",

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