Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

iframe-click-element

Click elements within iframes using selectors to interact with embedded content in browser automation workflows.

Instructions

Click the element in the iframe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesThe selector of the element to click, find from the page source code
iframeSelectorYesThe selector of the iframe to click, find from the page source code

Implementation Reference

  • The core handler function that performs the iframe element click using Playwright's frameLocator to target the iframe and click the specified selector within it.
    async iframeClickElement({ selector, iframeSelector }: IframeClickElementParams) { const frame = browser.pageInstance!.frameLocator(iframeSelector); if (!frame) { return `Iframe not found: ${iframeSelector}`; } await frame.locator(selector).click(); return `Clicked element ${selector} inside iframe ${iframeSelector} successfully`; },
  • Zod schema for input validation of the iframe-click-element tool, requiring 'selector' for the target element and 'iframeSelector' for the containing iframe.
    iframeClickElementSchema: z.object({ selector: z.string().describe('The selector of the element to click, find from the page source code'), iframeSelector: z.string().describe('The selector of the iframe to click, find from the page source code') }).strict(),
  • MCP tool registration for 'iframe-click-element', associating the name, description, input schema, and wrapped handler function.
    server.tool('iframe-click-element', 'Click the element in the iframe', schemas.iframeClickElementSchema.shape, wrapHandler(automationHandlers.iframeClickElement));

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/AdsPower/local-api-mcp-typescript'

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