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));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions clicking but doesn't disclose behavioral traits like whether it waits for the element to be clickable, handles errors, requires specific page states, or has side effects (e.g., page navigation). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation action with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what happens after clicking (e.g., return values, success/failure states) or address potential issues like iframe loading. For a tool that interacts with web elements, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('selector' and 'iframeSelector') with descriptions. The description adds no additional meaning beyond implying these selectors are used for clicking, which is redundant. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('click') and target ('element in the iframe'), which is clear but vague. It doesn't specify what type of element or distinguish it from sibling tools like 'click-element' (which presumably clicks elements outside iframes). The purpose is understandable but lacks specificity about the tool's unique scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an open browser or iframe context) or compare it to 'click-element', which is a direct sibling tool. The description implies usage only for iframe elements but doesn't explicitly state when to choose this over other clicking methods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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