Skip to main content
Glama

click

Simulate user clicks on web page elements for browser automation and testing. Specify an element's unique identifier to perform single or double-click actions in Chrome.

Instructions

Clicks on the provided element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesThe uid of an element on the page from the page content snapshot
dblClickNoSet to true for double clicks. Default is false.

Implementation Reference

  • Handler function for the 'click' tool that retrieves the element by UID, performs the click (or double-click) using Puppeteer's locator.click(), waits for events, updates response, and disposes the handle.
    handler: async (request, response, context) => {
      const uid = request.params.uid;
      const handle = await context.getElementByUid(uid);
      try {
        await context.waitForEventsAfterAction(async () => {
          await handle.asLocator().click({
            count: request.params.dblClick ? 2 : 1,
          });
        });
        response.appendResponseLine(
          request.params.dblClick
            ? `Successfully double clicked on the element`
            : `Successfully clicked on the element`,
        );
        response.setIncludeSnapshot(true);
      } finally {
        void handle.dispose();
      }
    },
  • Input schema for the 'click' tool using Zod: required 'uid' string and optional 'dblClick' boolean.
    schema: {
      uid: z
        .string()
        .describe(
          'The uid of an element on the page from the page content snapshot',
        ),
      dblClick: z
        .boolean()
        .optional()
        .describe('Set to true for double clicks. Default is false.'),
    },
  • src/main.ts:307-320 (registration)
    Registration of all tools including 'click' from inputTools: tools from input.ts are spread into the tools array via Object.values(inputTools) and each tool is registered with the MCP server using registerTool, which wraps the handler.
    const tools = [
      ...Object.values(consoleTools),
      ...Object.values(emulationTools),
      ...Object.values(inputTools),
      ...Object.values(networkTools),
      ...Object.values(pagesTools),
      ...Object.values(performanceTools),
      ...Object.values(screenshotTools),
      ...Object.values(scriptTools),
      ...Object.values(snapshotTools),
    ];
    for (const tool of tools) {
      registerTool(tool as unknown as ToolDefinition);
    }
  • src/main.ts:32-32 (registration)
    Import of input tools module which exports the 'click' tool definition.
    import * as inputTools from './tools/input.js';
Behavior3/5

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

The description adds minimal behavioral context beyond annotations. Annotations already declare readOnlyHint=false (indicating a state-changing action), but the description doesn't elaborate on what 'clicks' actually does (e.g., triggers events, may navigate, might fail if element not interactable). No contradiction with annotations exists, but the description carries most of the burden since annotations are sparse.

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?

Extremely concise with a single sentence that directly states the tool's purpose. No wasted words or unnecessary elaboration, making it easy to parse quickly.

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

Completeness3/5

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

For a tool with 2 parameters, no output schema, and minimal annotations, the description is adequate but incomplete. It covers the basic action but lacks context about prerequisites (e.g., needing a page snapshot), potential outcomes, or error conditions. Given the complexity and sibling tools available, more guidance would be beneficial.

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?

With 100% schema description coverage, the schema fully documents both parameters (uid and dblClick). The description adds no additional meaning about parameters beyond implying 'element' relates to 'uid'. Baseline score of 3 is appropriate 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.

Purpose4/5

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

The description clearly states the action ('clicks') and target ('on the provided element'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'hover' or 'double click' (which is actually a parameter option), leaving room for confusion about when to use this versus alternatives.

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 about when to use this tool versus alternatives. The description doesn't mention sibling tools like 'hover' for mouse positioning without clicking, 'dblClick' parameter for double-clicking, or context about requiring a page to be loaded first. 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/SHAY5555-gif/chrome-devtools-mcp'

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