Skip to main content
Glama

click

Simulate user interactions by clicking specified elements on web pages using CSS selectors, enabling efficient testing and automation of consent management platforms within a browser environment.

Instructions

Click elements on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to click

Implementation Reference

  • The switch case in handleToolCall function that implements the logic for the 'click' tool: clicks the element matching the given CSS selector using Puppeteer's page.click method, with success/error response handling.
    case "click": try { await page.click(args.selector); return { content: [ { type: "text", text: `Clicked: ${args.selector}`, }, ], isError: false, }; } catch (error) { return { content: [ { type: "text", text: `Failed to click ${args.selector}: ${(error as Error).message}`, }, ], isError: true, }; }
  • src/index.ts:66-78 (registration)
    The 'click' tool definition in the TOOLS array, which registers the tool with MCP server including its name, description, and input schema.
    name: "click", description: "Click elements on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click", }, }, required: ["selector"], }, },
  • The input schema for the 'click' tool, defining the required 'selector' parameter as a CSS selector string.
    inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click", }, }, required: ["selector"], },

Other Tools

Related 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/noisysocks/autoconsent-mcp'

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