Skip to main content
Glama

click_nth

Destructive

Clicks a specific element by zero-based index when multiple elements match a selector, helping resolve strict-mode violation errors by targeting the intended item.

Instructions

[Agent Browser] Click the nth element matching a selector (0-indexed). Use when multiple elements match and you need a specific one (e.g., 2nd button). Prefer this over click() when you get 'strict mode violation' errors.

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": {
      "selector": "<selector>",
      "index": "<index>"
    },
    "name": "click_nth"
  }
}

Input Schema

NameRequiredDescriptionDefault
indexYes
selectorYes

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false, so the mutation profile is covered by structured data rather than the text. The description adds only the strict-mode-violation context, and says nothing about out-of-range indices, element-not-found behavior, or whether it waits for the element before clicking.

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?

Three short lines: purpose first, then the usage condition, then the alternative trigger. Every sentence carries information that changes agent behavior, with no restatement of the tool name.

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?

With an output schema present and only two required scalar parameters, the definition covers what is needed to invoke the tool correctly. The remaining gap is failure-mode behavior (index out of range, selector matching nothing), which matters for a destructive click but is not addressed.

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 coverage is 0% and the schema labels the parameters only as "Index" and "Selector", so the description must compensate. It does so for index by specifying 0-based numbering, which is genuinely non-obvious and prevents off-by-one errors; the selector parameter is only described as "matching a selector" with no hint of accepted selector syntax.

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 the nth element matching a selector") and adds the non-obvious 0-indexed qualifier. It is immediately distinguishable from the sibling click() by its positional indexing, so an agent can choose between them without opening either 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?

Gives an explicit when-to-use condition (multiple matches, need a specific one, with a concrete "2nd button" example) and names the alternative plus the exact trigger for switching to it ("strict mode violation" errors). Nothing is left to inference about routing.

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