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);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Click an element' implies a user interaction that may trigger navigation or state changes, but it doesn't describe what happens after clicking (e.g., page reload, new window), error conditions, or performance considerations. This leaves significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and target, making it immediately scannable and appropriately sized for a simple tool.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., success/failure, new page state), error handling, or behavioral nuances like waiting for elements to be clickable. Given the complexity of web interaction, more context is needed.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'selector' clearly documented as 'CSS selector for the element to click'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description 'Click an element on the page' clearly states the action (click) and target (element on page), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'select' or 'type' which also interact with page elements, so it doesn't reach the highest score.

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

Usage Guidelines2/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 like 'select' or 'type' from the sibling list. It doesn't mention prerequisites (e.g., needing an element to be clickable) or exclusions, leaving the agent with minimal context for tool selection.

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

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