Skip to main content
Glama
epi-builder
by epi-builder

browser_click

Click on web page elements to automate browser interactions, using element references for precise targeting in Playwright automation workflows.

Instructions

Click on an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYesHuman-readable element description
refYesExact target element reference from page snapshot

Implementation Reference

  • The core handler function that executes the browser_click tool logic. It ensures a browser page is open and performs a click action (currently a placeholder clicking on 'body').
    private async handleClick(element: string, ref: string) {
      await this.ensureBrowser();
      
      // Simple click implementation - in a real implementation,
      // you would parse the ref to find the actual element
      await this.browserState.page!.click('body'); // Placeholder
      
      return {
        content: [
          {
            type: 'text',
            text: `Clicked on ${element}`,
          },
        ],
      };
    }
  • src/server.ts:82-99 (registration)
    Registration of the browser_click tool in the list of available tools, including its name, description, and input schema definition.
    {
      name: 'browser_click',
      description: 'Click on an element',
      inputSchema: {
        type: 'object',
        properties: {
          element: {
            type: 'string',
            description: 'Human-readable element description',
          },
          ref: {
            type: 'string',
            description: 'Exact target element reference from page snapshot',
          },
        },
        required: ['element', 'ref'],
      },
    },
  • Dispatch case in the CallToolRequestSchema handler that routes browser_click calls to the handleClick method.
    case 'browser_click':
      return await this.handleClick(args?.element as string, args?.ref as string);
  • Helper method used by browser_click handler to ensure a browser and page are initialized.
    private async ensureBrowser() {
      if (!this.browserState.browser) {
        this.browserState.browser = await chromium.launch({
          headless: false,
        });
      }
      if (!this.browserState.page) {
        this.browserState.page = await this.browserState.browser.newPage();
      }
    }
Behavior2/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 mutation action (interacting with the browser), but it doesn't disclose critical traits such as what happens on failure (e.g., if element not found), whether it waits for page loads, if it requires specific permissions, or any side effects. This leaves significant gaps for a tool that performs browser interactions.

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 'Click on an element' is a single, efficient sentence that front-loads the core action without unnecessary words. It earns its place by directly stating the tool's function, making it highly concise and well-structured for quick understanding.

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?

Given the complexity of browser interaction tools, the description is incomplete. No annotations exist to cover behavioral aspects, and there's no output schema to explain return values. The description alone fails to address key context like error handling, dependencies on other tools (e.g., 'browser_snapshot'), or what constitutes a successful click, making it inadequate for safe and effective use.

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?

The input schema has 100% description coverage, with clear documentation for both parameters ('element' as human-readable description and 'ref' as exact target reference). The description adds no additional meaning beyond what the schema provides, such as explaining how these parameters interact or usage examples. With high schema coverage, the baseline score of 3 is appropriate.

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 on an element' clearly states the action (click) and target (an element), providing a specific verb+resource combination. However, it doesn't differentiate this tool from potential sibling interactions like 'browser_type' or 'browser_navigate' in terms of when clicking is the appropriate interaction versus typing or navigation.

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. It doesn't mention prerequisites (e.g., requiring a page snapshot first), exclusions (e.g., not for non-clickable elements), or comparisons to sibling tools like 'browser_type' for text input. Usage is implied but not explicitly stated.

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/epi-builder/mcp-test'

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