Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_iframe_click

Click an element within an iframe on a webpage using CSS selectors for the iframe and target element, enabling precise interactions in browser automation scenarios.

Instructions

Click an element in an iframe on the page

Input Schema

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

Implementation Reference

  • IframeClickTool class implementation. Uses page.frameLocator to find iframe and clicks the specified selector within it using Playwright.
    export class IframeClickTool extends BrowserToolBase { /** * Execute the iframe click 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).click(); return createSuccessResponse(`Clicked element ${args.selector} inside iframe ${args.iframeSelector}`); }); } }
  • JSON schema definition for the playwright_iframe_click tool inputs.
    name: "playwright_iframe_click", description: "Click 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 click" }, selector: { type: "string", description: "CSS selector for the element to click" }, }, required: ["iframeSelector", "selector"], }, },
  • Switch case in handleToolCall that registers and dispatches to the IframeClickTool handler.
    case "playwright_iframe_click": return await iframeClickTool.execute(args, context);
  • Instantiation of IframeClickTool instance in initializeTools function.
    if (!iframeClickTool) iframeClickTool = new IframeClickTool(server);
  • src/tools.ts:454-454 (registration)
    Inclusion in BROWSER_TOOLS array for conditional browser setup.
    "playwright_iframe_click",

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