Skip to main content
Glama

click

Automate web element interaction by clicking specified page elements using CSS selectors for browser automation and testing workflows.

Instructions

Click an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to click

Implementation Reference

  • Registration of the 'click' MCP tool, defining its name, description, input schema, and handler function that delegates to browser.click
    { name: 'click', description: 'Click an element on the page', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the element to click' } }, required: ['selector'] }, handler: async ({ selector }) => { await browser.click(selector); return { success: true, message: `Clicked element: ${selector}` }; } },
  • Input schema for the 'click' tool requiring a CSS selector
    inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the element to click' } }, required: ['selector'] },
  • The handler function for the 'click' tool, which performs the click action via the browser instance and returns a success message
    handler: async ({ selector }) => { await browser.click(selector); return { success: true, message: `Clicked element: ${selector}` }; }
  • Helper method in SimpleBrowser class that implements the actual click using Playwright's page.click
    async click(selector) { await this.ensureLaunched(); await this.page.click(selector); }
  • index.js:74-76 (registration)
    Creation of the tools array (including 'click') that is used to register tools with the MCP server request handlers
    // Register all available automation tools const tools = createTools(browser);

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/zypin-testing/zypin-mcp'

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