Skip to main content
Glama

css_var

Trace where a CSS custom property is defined and used across .css files, HTML blocks, and style attributes by name.

Instructions

Where is this --custom-property defined and used? Example: css_var(name="--bg").

The CSS/HTML language servers only see one file at a time, so var(--x) usages can't be cross-referenced across files that way. This scans .css files and HTML <style>/style="…" blocks/attributes instead. name may be given with or without the leading --. Definitions (value + enclosing context, e.g. @media (prefers-color-scheme: dark) › :root) and usages (grouped by file with line numbers) are reported separately per configured root (see WEBNAV_MCP_ROOTS; a single unnamed root by default), since each may define its own values. query is accepted as an alias for name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
queryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/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 well: it discloses the scan scope (`.css` files plus HTML style blocks/attributes), that definitions and usages are reported separately per configured root, and references the `WEBNAV_MCP_ROOTS` config with a single unnamed root default. It stops short of noting scanning cost, limits, or ignored files.

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

Conciseness4/5

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

The core question is front-loaded with an inline example (`css_var(name="--bg")`), and the remaining sentences each add distinct detail (cross-file rationale, scan scope, output grouping, roots, alias). It is dense and slightly long but no sentence is redundant.

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?

There is no output schema, so the description must describe returns, and it does: definitions include value plus enclosing context (e.g. `@media (...) › :root`) and usages are grouped by file with line numbers, per root. For a 2-param, no-annotation tool this is nearly complete, missing only error/empty-result behavior.

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%, so the description must compensate, and it does: it states `name` may be supplied with or without the leading `--`, and that `query` is an accepted alias for `name`. Both parameters are addressed, though neither is marked optional despite required count being zero.

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 opening question states a specific resource (a `--custom-property`) and the exact action (finding where it is defined and used). It also draws an explicit boundary against sibling language-server tools like `references`/`definition` by noting those only see one file at a time, so an agent can route correctly without opening a schema.

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 clearly implies when to use this over the file-scoped language servers: cross-file `var(--x)` lookups across `.css` files and HTML `<style>`/`style=` blocks. There is no explicit 'do not use when' clause, but the alternative and its limitation are spelled out, which is strong routing guidance.

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