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';

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