Skip to main content
Glama

click

Simulate precise clicks on specific web elements in Firefox using Playwright. Define elements by selector or coordinates, and control actions across multiple tabs for browser automation and debugging tasks.

Instructions

Click on an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coordinatesNo
selectorNo
tabIdNo

Implementation Reference

  • The core handler function for the 'click' tool that executes Playwright page.click either on a selector or at specific coordinates in the specified tab.
    async click(args) { this.ensureBrowserRunning(); const { selector, coordinates, tabId } = args; const page = this.getPage(tabId); if (coordinates) { await page.click(`body`, { position: coordinates }); return { content: [{ type: 'text', text: `Clicked at coordinates (${coordinates.x}, ${coordinates.y}) in tab '${tabId || this.activeTabId}'` }] }; } else if (selector) { await page.click(selector); return { content: [{ type: 'text', text: `Clicked element '${selector}' in tab '${tabId || this.activeTabId}'` }] }; } else { throw new Error('Either selector or coordinates must be provided'); } }
  • Registration of the 'click' tool in the CallToolRequestSchema switch statement, dispatching to the click handler.
    case 'click': return await this.click(args);
  • Tool definition in ListToolsRequestSchema including name, description, and input schema for the 'click' tool.
    { name: 'click', description: 'Click on an element', inputSchema: { type: 'object', properties: { selector: { type: 'string' }, coordinates: { type: 'object', properties: { x: { type: 'number' }, y: { type: 'number' } } }, tabId: { type: 'string' } } } },

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/JediLuke/firefox-mcp-server'

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