Skip to main content
Glama

candidates

Read-only

Resolve ambiguous locators by listing all matching elements with details, enabling selection by index to avoid strict mode failures.

Instructions

List EVERY element a target resolves to, so an ambiguous locator can be disambiguated instead of failing strict mode. Returns {target, count, candidates:[{index, tag, role, name, text, bbox}], truncated}. Act on one with click/fill/type/hover passing index=N.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leaseNoOptional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env.
limitNoCap how many matches to describe.
targetYes@eN / @text: / @label: / CSS whose matches to enumerate.
sessionNoOptional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already establish `readOnlyHint: true` and `openWorldHint: true`, so the description need not repeat that. It adds valuable behavior details: the return structure includes a `truncated` flag, indicating results may be limited, and it clarifies that the tool returns a comprehensive list. No contradiction.

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?

Two sentences with zero fluff. The first sentence front-loads the purpose and return shape; the second explains how to act on results. Every word earns its place, making it easy to parse for an agent.

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

Completeness5/5

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

Given the moderate complexity (4 params, no nested objects, no output schema), the description thoroughly covers the return structure (`target`, `count`, `candidates` with fields, `truncated`) and how to consume it. It also mentions the `lease` token context. Nothing essential is missing for correct invocation.

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 100% (all params have descriptions), but the description adds significant semantic value beyond the schema: it explains the `target` syntax variants (`@eN`, `@text:`, `@label:`, CSS) and gives practical guidance for the `session` parameter on shared daemons (use a unique name). This goes beyond what the schema descriptions provide.

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 states a specific verb ('List'), a concrete resource ('every element a target resolves to'), and the intended purpose ('disambiguate an ambiguous locator instead of failing strict mode'). This clearly differentiates it from siblings like 'find' or 'count' by focusing on enumeration for disambiguation.

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?

It explicitly describes when to use the tool: when a locator is ambiguous and would otherwise fail strict mode. It also instructs how to act on results with `index=N`, implying the follow‑up workflow. It doesn't mention alternatives or when not to use it, but the context is clear enough.

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