Skip to main content
Glama

selector

Find every usage of a CSS #id or .class across HTML, CSS, and JavaScript files. Cross-reference definitions, attributes, and DOM API calls to trace where they are used.

Instructions

Who uses this #id or .class? Example: selector(name=".card-title").

Looks up the selector across the whole workspace.

Cross-references CSS rule definitions, HTML id=/class= attributes, and JS usages (getElementById, classList.add/remove/toggle/contains, querySelector/querySelectorAll, className assignment, and any JS string literal exactly equal to the bare name — e.g. an id passed to a project's own helper like onClick("btn-save", …), labeled "string literal"). Hits in generated output (WEBNAV_MCP_EXCLUDE) are labeled [generated]; edit their source instead. This is something the single-file CSS/HTML language servers can't do. name must include the leading # or .. Grouped by file with line numbers, separately per configured root (see WEBNAV_MCP_ROOTS). A JS hit built from string concatenation (e.g. getElementById("view-" + x)) is reported against only its static prefix and labeled "dynamic partial match"; a query whose name starts with such a prefix (e.g. #view-components against a stored #view-) also surfaces that hit, labeled "dynamic partial match via ''", instead of being silently dropped or guessed. query is accepted as an alias for name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
queryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A3.9/5.0
Behavior5/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 so richly: it enumerates the cross-referenced surfaces (CSS rules, HTML id/class attrs, JS APIs and bare string literals), labels generated hits `[generated]`, explains `dynamic partial match` and prefix-query behavior, and states grouping by file/line per root. A reader knows exactly what comes back and why.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and example are correctly front-loaded, but the body is a dense prose block mixing invocation rules, labeling semantics, and configuration env-vars (`WEBNAV_MCP_EXCLUDE`, `WEBNAV_MCP_ROOTS`) without structure. Most sentences earn their place, but readability suffers from lack of bullets or ordering.

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 high-complexity cross-referencing lookup, the description covers the behavioral contract thoroughly, and an output schema exists so return shape needn't be re-explained. It stops short of stating read-only/auth posture, which would matter in the absence of annotations, but otherwise nothing essential is missing.

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 description coverage is 0%, so the description must compensate, and it does: it mandates the leading `#` or `.` on `name`, gives a concrete example, and declares `query` as an alias for `name`. It does not explain what happens if only one of the two aliases is supplied, but the key formatting constraint is covered.

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 lead sentence 'Who uses this `#id` or `.class`?' plus the example call makes the specific verb (find usages) and resource (CSS selector) unambiguous. It distinguishes itself from generic single-file language servers, but never names or contrasts with the overlapping sibling `references`, so an agent must still infer the boundary.

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

Usage Guidelines3/5

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

Usage is implied by 'Looks up the selector across the whole workspace' and the example call, and it notes hits in `WEBNAV_MCP_EXCLUDE` output should be edited at source. However there is no explicit when-to-use-this-vs-`references`/`definition`/`hover` guidance despite those siblings clearly overlapping.

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