Skip to main content
Glama

session_click_selector

Clicks an element on the current session page by CSS selector; use an optional index to target one match when several elements share the selector.

Instructions

Click an element on the session's current page, located by a CSS selector.

Requires a session opened with profile_start first. selector is a CSS selector (e.g. "button#submit", "a.nav-link") — not an XPath, not a role/name pair (use session_snapshot to find one).

Args: name: identity name, exactly as profiles_list reports it. selector: CSS selector for the element to click. nth: optional, 0-based — which element to use when the selector matches several. Leave it out and a selector that matches several elements fails with "matched N elements"; then write a more specific selector or pass nth.

Returns {ok: true}. Fails with a readable message if the session is not open (409 — call profile_start first), the identity does not exist (404), the selector matches several elements and no nth was given, or the selector never matches / the click times out (502).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "selector": "<selector>"
    },
    "name": "session_click_selector"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNo
nameYes
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.7
    • addedInput schema / properties / nth
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Nth"
      +}
  2. First observedv0.1.5

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: return shape ({ok: true}), failure semantics for 409/404/502, the "matched N elements" ambiguity error, and timeout behavior. The notable gap is side effects — a click can submit forms or trigger irreversible actions, and nothing warns about that or about whether the call waits for resulting navigation.

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 critical constraint (CSS-only locator) sits in the first sentence, then prerequisites, then per-argument notes, then failure modes — a sensible front-loaded order with no filler. The error-code enumeration in the final sentence is dense but each clause is actionable, so nothing is clearly wasted.

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 3-parameter interaction tool with no annotations and no output schema, the description supplies the gap the structured fields leave: prerequisites, return contract, and four distinct failure paths. It falls just short of complete because click semantics (waiting, navigation, side effects) are left implicit.

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 coverage is 0%, so the description must compensate, and it does: `name` is pinned to "exactly as profiles_list reports it", `selector` is constrained to CSS syntax with two concrete examples, and `nth` is defined as 0-based, optional, with the exact failure it prevents. All three parameters gain meaning the bare schema does not supply.

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?

States a specific verb and resource ("Click an element on the session's current page, located by a CSS selector") and immediately scopes the locator strategy, ruling out XPath and role/name pairs. That negative scoping is what separates it from session_snapshot and session_fill_selector without the agent opening another schema.

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

Usage Guidelines5/5

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

Names the prerequisite explicitly ("Requires a session opened with profile_start first") and routes the agent elsewhere when the locator style does not fit ("use session_snapshot to find one"). It also gives a decision rule for the ambiguous-match case: tighten the selector or pass nth, rather than leaving the agent to guess.

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