Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

click-element

Simulate clicking on web page elements using CSS selectors to automate browser interactions within AdsPower profiles.

Instructions

Click the element

Input Schema

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

Implementation Reference

  • The core handler function for the 'click-element' tool. It checks if the browser is connected, clicks the element using the provided CSS selector on the current page, and returns a success message.
    async clickElement({ selector }: ClickElementParams) {
        browser.checkConnected();
        await browser.pageInstance!.click(selector);
        return `Clicked element with selector: ${selector} successfully`;
    },
  • Zod schema for input validation of the 'click-element' tool, defining a required 'selector' string parameter.
    clickElementSchema: z.object({
        selector: z.string().describe('The selector of the element to click, find from the page source code')
    }).strict(),
  • Registers the 'click-element' tool with the MCP server, providing name, description, input schema, and wrapped handler function.
    server.tool('click-element', 'Click the element', schemas.clickElementSchema.shape,
        wrapHandler(automationHandlers.clickElement));
Behavior1/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 of behavioral disclosure. 'Click the element' implies a mutation action (interacting with a UI), but it doesn't describe effects (e.g., page navigation, form submission), error handling, or requirements (e.g., element must be visible). This is inadequate for a tool with potential side effects.

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 extremely concise with 'Click the element', a single sentence that directly states the action. It's front-loaded with no wasted words, making it efficient and easy to parse, though this conciseness contributes to gaps in other dimensions.

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 complexity of a UI interaction tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects, return values, or context needed for effective use. Sibling tools suggest a browser automation context, but this isn't explained, leaving significant gaps.

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?

The input schema has 1 parameter with 100% description coverage, detailing 'selector' as 'The selector of the element to click, find from the page source code'. The description adds no additional meaning beyond this, but with high schema coverage, the baseline is 3 as 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 'Click the element' states a clear verb ('click') and resource ('the element'), but it's vague about what type of element or context. It doesn't distinguish from sibling tools like 'iframe-click-element' or 'hover-element', which perform similar actions on elements. The purpose is understandable but lacks specificity.

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 page), exclusions, or comparisons to siblings like 'iframe-click-element' for iframes or 'hover-element' for hovering. Usage is implied but not explicitly stated.

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