Skip to main content
Glama

browser_click

Click an element on a webpage by CSS selector or visible text, then capture any JavaScript alert, confirm, or prompt dialogs to detect XSS.

Instructions

Click an element on the page. Returns any JavaScript alert/confirm/prompt dialog messages triggered.

PREREQUISITE: browser_open and browser_go must have been called first.

Provide EITHER selector OR text (not both):

  • selector: CSS selector for the element (e.g. "#login-btn", "button[type=submit]")

  • text: Visible text to find and click (uses best match, e.g. "Login", "Submit")

XSS DETECTION: If clicking triggers a JavaScript alert() dialog, the dialog message is returned. This is how you verify reflected/stored XSS — inject a payload, navigate to the page, and check for alerts.

Args: selector: CSS selector to click (e.g. "#submit", "button.login") text: Visible text to find and click (e.g. "Login", "Submit Order") session_name: Browser session to use (default: "default")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
tab_idNo
selectorNo
session_nameNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations available, the description carries the burden for behavioral disclosure. It reveals that clicking returns any JavaScript alert/confirm/prompt dialog messages, which is important for XSS detection, and states the prerequisite. It also cautions against providing both selector and text. However, it does not disclose behavior for missing elements, multiple matches, or page navigation after click, so it is not fully transparent.

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

Conciseness4/5

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

The description is well-structured with clear sections (prerequisites, parameter selection, XSS detection, Args) and front-loads the core action and return value. It is slightly repetitive because the Args section re-lists selector, text, and session_name with similar examples as the bullets above, but overall it is efficient and focused.

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

Completeness4/5

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

Given the tool's complexity, the description covers essential context: prerequisites, selector/text XOR logic, dialog return for XSS detection, and session parameter. The presence of an output schema reduces the need to explain return values. Missing pieces include tab_id, error handling for not-found elements, and behavior after a click that triggers navigation. These gaps prevent a perfect score, but the description is otherwise comprehensive.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explains selector (CSS selector with examples), text (visible text with best-match hint), and session_name (browser session, default). A notable gap is the complete omission of tab_id, one of the four schema parameters. The description also doesn't specify what happens if both selector and text are omitted. Despite this, it adds substantial semantics beyond the schema's bare properties.

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

Purpose5/5

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

The description opens with a specific verb and target: 'Click an element on the page.' It also mentions the resource (page) and differentiates from sibling tools like browser_type (typing) and browser_go (navigation) by focusing on click behavior and return of dialog messages. The XSS detection use case further clarifies a distinct purpose.

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

Usage Guidelines4/5

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

The description provides clear usage context: it states the prerequisite (browser_open and browser_go), explains the selector vs. text choice ('Provide EITHER selector OR text (not both)'), and gives a specific use case for XSS verification. However, it does not explicitly mention alternatives or when not to use this tool, so it earns a 4 rather than a 5.

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/BobongKu/nodriver-proxy-mcp'

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