Skip to main content
Glama

count

Read-only

Count matching elements for a CSS selector or @eN reference to determine if expected items exist.

Instructions

Count matching elements for a selector or @eN ref.

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.
targetYes@eN or selector.
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

B3.2/5.0
Behavior3/5

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

Annotations declare readOnlyHint: true, which is consistent with the description's 'Count' operation. The description adds little beyond that: it clarifies input forms but does not disclose the return type (e.g., integer) or behavior when no matches are found. Since annotations already cover safety, a baseline 3 is appropriate; the description adds minimal context.

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?

One sentence, front-loaded with the action, and no redundant words. Every phrase earns its place, and the description is appropriately short for a simple operation.

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

Completeness2/5

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

For a tool with no output schema, the description should at minimum reveal what the return value is (a count of matching elements) and ideally when to prefer it over sibling tools. It only hints at the input. The absence of any usage context or return semantics makes this incomplete for an agent deciding between 'count' and 'find'.

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

Parameters3/5

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

The input schema already provides descriptions for all three parameters (100% coverage), so the tool description does not need to repeat them. The phrase 'for a selector or @eN ref' restates the 'target' parameter, but adds no new semantic detail. Baseline 3 is correct when the schema carries the documentation burden.

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

Purpose4/5

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

The description states a clear verb ('Count') and resource ('matching elements'), and specifies the input types (selector or @eN ref). It does not explicitly differentiate from sibling tools like 'find' or 'candidates', but the action of counting is distinct enough. A clear purpose but with room to name alternatives.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. It doesn't mention that 'find' returns elements rather than a count, or suggest 'count' when only a number is needed. The usage context is left entirely to the agent's inference, which is insufficient given the large set of sibling tools.

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