Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

iframe-click-element

Click elements within iframes using specific selectors to interact with embedded content during browser automation tasks.

Instructions

Click the element in the iframe

Input Schema

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "iframeSelector": { "description": "The selector of the iframe to click, find from the page source code", "type": "string" }, "selector": { "description": "The selector of the element to click, find from the page source code", "type": "string" } }, "required": [ "selector", "iframeSelector" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the iframe-click-element tool logic using Playwright's frameLocator to click an element inside a specified iframe.
    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 defining the input parameters (selector and iframeSelector) for the iframe-click-element tool.
    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(),
  • Tool registration call that associates the name 'iframe-click-element' with its description, 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