Skip to main content
Glama

click

Trigger actions on web elements using CSS or text selectors, with control for specific matches, visibility, scrolling, and timeouts.

Instructions

Click one or more elements matching a selector.

This is the primary element-clicking tool. The selector may be a CSS selector or SeleniumBase text-matching selector such as 'a:contains("Sign in")'.

Args: selector: Target CSS selector or text-matching selector. nth: Click only the Nth matching element, using 1-based indexing. Takes priority over all_matches. all_matches: Click every currently visible matching element, in order. Ignored when nth is provided. only_if_visible: Attempt the click only when the target is already visible. Does not wait for the element to become visible. parent_selector: Restrict the nested lookup to a parent element. Useful for elements inside iframes or nested containers when supported by SeleniumBase. timeout: Seconds to wait for a basic click when no specialized mode is selected. Defaults to 7 seconds. scroll: Scroll the target into view before clicking.

Tool selection: - Click one matching element -> basic click. - Click a specific matching occurrence -> set nth. - Click every visible match -> set all_matches=True. - Click only when already visible -> set only_if_visible=True. - Click an element nested inside another element -> set parent_selector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nthNo
scrollNo
timeoutNo
selectorYes
all_matchesNo
only_if_visibleNo
parent_selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.2.5
    • removedInput schema / properties / timeout / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / timeout / type
      Added value: +"number"
  2. Changed1 schema field changedv1.2.1
    • changedInput schema / properties / timeout / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed5 schema fields changedv1.2.0
    • addedInput schema / properties / all_matches
      Added value: +{
      +  "default": false,
      +  "title": "All Matches",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / nth
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Nth"
      +}
    • addedInput schema / properties / only_if_visible
      Added value: +{
      +  "default": false,
      +  "title": "Only If Visible",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / parent_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Parent Selector"
      +}
    • changedInput schema / properties / timeout / default
      Previous value: -nullNew value: +7
  4. Changed3 schema fields changedv1.0.2
    • removedInput schema / properties / by
      Removed value: -{
      -  "default": "css",
      -  "title": "By",
      -  "type": "string"
      -}
    • addedInput schema / properties / scroll
      Added value: +{
      +  "default": true,
      +  "title": "Scroll",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Timeout"
      +}
  5. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses important behaviors: only_if_visible does not wait for visibility, nth takes priority over all_matches, all_matches clicks visible matches in order, parent_selector support is conditional, and timeout defaults to 7 seconds. It does not describe failure behavior when no element matches, but the coverage is otherwise strong.

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 long but well-organized with an Args section and a Tool selection summary. Some information is repeated between these sections, but the repetition serves as a quick-reference and the core purpose is front-loaded.

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?

For a tool with 7 parameters, zero annotations, and no explanatory output schema, the description covers purpose, selector syntax, all parameters, defaults, precedence, visibility semantics, and scoping caveats. It is missing explicit edge-case behavior such as what happens when no element matches, but the overall guidance is sufficiently complete for an agent to invoke the tool correctly.

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

Parameters5/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, and it does. Every parameter is explained with meaningful semantics: nth's 1-based indexing and precedence, all_matches' visibility and ordering, only_if_visible's no-wait behavior, parent_selector's iframe/nested-container usefulness, timeout's default, and scroll's intent.

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 action and resource: "Click one or more elements matching a selector," and declares itself "the primary element-clicking tool." It clearly identifies the tool's role among browser-interaction siblings and distinguishes supported selector syntax (CSS and SeleniumBase text-matching).

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 gives clear context for when to use this tool: when an element click is needed, and it is labeled the primary click tool. The "Tool selection" section provides actionable recipes for different click scenarios, though it does not explicitly contrast the tool with alternatives like hover_with_action or find_elements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/seleniumbase/seleniumbase-mcp'

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