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' }
        }
      }
    },
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Click on an element' implies a user interaction but reveals nothing about side effects (e.g., page navigation, state changes), error conditions (e.g., if the element is missing), performance (e.g., timing delays), or response format. This is inadequate for a tool with potential mutative effects in a browser automation context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise ('Click on an element') but under-specified, not efficiently informative. It uses a single sentence that is front-loaded but lacks necessary detail, making it more sparse than appropriately brief. While not verbose, it does not earn its place by adding value beyond the tool name.

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

Completeness1/5

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

Given the complexity of browser automation (with 3 parameters, nested objects, and no output schema) and the absence of annotations, the description is severely incomplete. It does not cover parameter usage, behavioral outcomes, error handling, or integration with sibling tools (e.g., 'navigate' or 'wait_for_element'). This leaves critical gaps for an agent to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 3 parameters (coordinates, selector, tabId) with 0% description coverage, meaning none are documented in the schema. The description adds no information about these parameters—it does not explain what 'coordinates' or 'selector' refer to, how they interact, or which parameter(s) are required for clicking. This fails to compensate for the schema's lack of documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

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

The description 'Click on an element' is a tautology that restates the tool name 'click' with minimal elaboration. It specifies a verb ('click') but only vaguely identifies the resource ('an element') without clarifying what constitutes an element in this context (e.g., UI element, DOM element). It does not distinguish this tool from siblings like 'drag' or 'send_key', which also interact with elements.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an open tab or loaded page), exclusions (e.g., when elements are not clickable), or comparisons to sibling tools like 'drag' or 'send_key'. Without any context, an agent cannot infer appropriate usage scenarios.

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

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

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