count
Returns the number of elements matching a CSS selector, helping AI agents verify Electron UI states during Playwright tests.
Instructions
Count elements matching selector
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector |
Returns the number of elements matching a CSS selector, helping AI agents verify Electron UI states during Playwright tests.
Count elements matching selector
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector |
Changes observed during successful MCP inspections.
v0.1.1Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden and mostly fails it. It does not say what is returned (a numeric count), whether it throws on an invalid selector, or whether it waits for elements to appear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One short sentence with no filler, front-loaded on the action. It is efficient, though the terseness is partly under-specification rather than disciplined conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description should at minimum describe the return value (a count) and failure behavior for an invalid selector. It leaves those gaps entirely unaddressed for a tool whose whole purpose is producing a count.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and there is a single well-documented 'selector' parameter (CSS selector), so the schema does the heavy lifting. The description adds no syntax or format detail beyond the schema, which is the baseline-3 case.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb (Count) and resource (elements matching selector), which is unambiguous within a browser-automation toolset. It does not differentiate itself from siblings like getText or isVisible, but the counting operation is distinct enough that an agent can identify it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives such as isVisible, getAttribute, or evaluate that could also inspect DOM elements. There are no exclusions or prerequisite conditions stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.