Skip to main content
Glama

Extract design tokens

extract_design_tokens
Read-only

Extract the design tokens a stylesheet actually uses. Pass css (free) or a public url (Pro; every linked and inline stylesheet is read). Returns colors (hex, with alpha kept, grouped as text, background, border), font families, font sizes, weights, line heights, spacing from margin, padding and gap, radii, shadows, z-index values, media-query breakpoints, and transition durations and easings, each with a use count and where it was used. Custom properties are resolved through var() chains, with light and dark values side by side and unused variables listed. Output includes a W3C design tokens (DTCG) tree of the custom properties and a markdown summary. Reads CSS text only: styles injected by JavaScript, computed styles and inline style attributes are not seen.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "extract_design_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoCSS text to read (a stylesheet, or several concatenated). Free up to 100,000 characters; Pro up to 2,000,000.
urlNoPro only. Public page whose linked and inline stylesheets are fetched (up to 12 sheets, 5 MB).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, non-destructive, open-world), and the description adds substantial context beyond them: free vs Pro input limits, a 12-sheet / 5 MB fetch cap, var() chain resolution with light/dark pairing, unused-variable reporting, and the explicit blind spot for JS-injected and computed styles. That is exactly the behavioral detail an agent needs to avoid misuse.

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?

Front-loaded with the verb and purpose, then dense but non-redundant output enumeration, ending on the most decision-relevant caveat. It is a long single block and the token list could be compressed, but nearly every clause carries information.

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?

With no output schema, the description carries the full return-value burden and does so thoroughly: per-category use counts and usage locations, a DTCG tree of custom properties, and a markdown summary. Combined with the input-mode and limitation disclosure, an agent can call this correctly without further probing.

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?

Schema description coverage is 100%, so both parameters are already documented with sizes and the Pro-only constraint; the description largely restates that. It adds only the marginal detail that a fetched url reads every linked and inline stylesheet, so the baseline of 3 applies.

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?

States a specific verb and resource ('Extract the design tokens a stylesheet actually uses') and immediately scopes it with the enumerated token categories, which separates it from conversion siblings like css_to_dtcg and audit-oriented ones like audit_token_scales or compare_token_sets. The 'actually uses' phrasing also signals the extraction/inventory intent rather than validation or transformation.

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?

Gives clear input selection guidance ('Pass css (free) or a public url (Pro)') and a firm boundary on what it will not process: JS-injected styles, computed styles, and inline style attributes are invisible. It stops short of naming an alternative sibling for those cases (e.g. a rendered-page audit), so an agent must infer the fallback.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources