Skip to main content
Glama

Extract Tokens from CSS or a Website

extract_css_tokens

Extract design tokens—colors, fonts, font sizes, radii, spacing, and shadows—from a website's live stylesheets or pasted CSS, with no screenshots or API key required.

Instructions

Read a live website's stylesheets (or CSS you paste) and extract design tokens: colors, fonts, font sizes, radii, spacing and shadows. No screenshot or API key needed. Best on sites with real stylesheets; for pages styled by JavaScript, use capture_url with the vision tools.

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_css_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoCSS text to analyze instead of a URL
urlNoPage URL (http or https)
formatNojson

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses that it fetches live stylesheets rather than screenshots, needs no API key, and degrades on JS-styled pages, but says nothing about fetch failures, private or non-public URLs, rate limits, or which input wins when both css and url are supplied.

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?

Three tight sentences with no filler, and the core capability is front-loaded ahead of the limitation and the alternative. Slight redundancy between the title and the first clause, but nothing that wastes an agent's attention.

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

Completeness3/5

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

There is no output schema, and the description does not characterize the returned token structure or how the five format variants differ. For a 3-parameter extraction tool with zero required parameters and no annotations, the definition should cover the empty-input case and the output shape.

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 coverage is 67% and the description reinforces the css-vs-url alternative ('CSS you paste' instead of a URL), which is genuinely useful given both are optional. However, the five-value format enum (json, css, tailwind, w3c, figma) is never explained, and the description does not state what happens when neither css nor url is provided.

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?

A specific verb and resource: reads a live website's stylesheets or pasted CSS and extracts design tokens, with the token categories enumerated (colors, fonts, font sizes, radii, spacing, shadows). It also distinguishes itself from capture_url for JavaScript-styled pages, so an agent can route 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 Guidelines5/5

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

Gives an explicit preferred condition ('best on sites with real stylesheets'), a negative condition ('pages styled by JavaScript'), and names the alternative to use instead (capture_url with the vision tools). It also states the no-screenshot/no-API-key requirement, which affects whether it can be used at all.

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