Skip to main content
Glama

list_tokens

List Aurum design tokens by category such as color, spacing, or typography, or get a summary of all categories with token counts.

Instructions

List Aurum design tokens by category: color (semantic + visual palette), spacing, radius, borderWidth, iconSize, elevation, typography. Omit category to get a summary of all categories with counts. Pass a category for the full table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoToken category to expand. Omit for a summary across all categories.

Implementation Reference

  • The async handler function that executes the list_tokens tool logic. It either returns a summary of all token categories (when no category arg is given) or a detailed markdown table for a specific category (color, spacing, radius, borderWidth, iconSize, elevation, typography).
      async handler(manifest, args) {
        const category = args.category as TokenCategory | undefined;
    
        if (!category) {
          const t = manifest.tokens;
          const semCount = Object.values(t.color.semantic).reduce((a, b) => a + b.length, 0);
          const visCount = Object.values(t.color.visual).reduce((a, b) => a + b.length, 0);
          const lines: string[] = [
            "# Aurum tokens (summary)",
            "",
            `- **color.semantic**: ${semCount} swatches across ${Object.keys(t.color.semantic).length} groups`,
            `- **color.visual**: ${visCount} swatches across ${Object.keys(t.color.visual).length} families`,
            `- **spacing**: ${t.spacing.length} steps`,
            `- **radius**: ${t.radius.length} steps`,
            `- **borderWidth**: ${t.borderWidth.length} steps`,
            `- **iconSize**: ${t.iconSize.length} steps`,
            `- **elevation**: ${t.elevation.length} levels`,
            `- **typography**: ${t.typography.length} roles`,
            "",
            "Call `list_tokens({ category: \"...\" })` for a specific table.",
          ];
          return { content: [{ type: "text", text: withFooter(manifest, lines.join("\n")) }] };
        }
    
        const lines: string[] = [`# Aurum tokens · ${category}`, ""];
    
        if (category === "color") {
          lines.push("## Semantic colours");
          lines.push("");
          for (const group of Object.keys(manifest.tokens.color.semantic).sort()) {
            const swatches = manifest.tokens.color.semantic[group];
            lines.push(`### ${group} (${swatches.length})`);
            lines.push("");
            lines.push(mdTable([
              ["name", "hex", "alpha", "figma path"],
              ...swatches.map((s) => [`\`${s.name}\``, `\`${s.hex}\``, s.alpha === 1 ? "1" : s.alpha.toFixed(2), `\`${s.path}\``]),
            ]));
            lines.push("");
          }
          lines.push("## Visual palette");
          lines.push("");
          for (const family of Object.keys(manifest.tokens.color.visual).sort()) {
            const swatches = manifest.tokens.color.visual[family];
            lines.push(`### ${family} (${swatches.length})`);
            lines.push("");
            lines.push(mdTable([
              ["name", "hex"],
              ...swatches.map((s) => [`\`${s.name}\``, `\`${s.hex}\``]),
            ]));
            lines.push("");
          }
        } else if (category === "elevation") {
          lines.push(mdTable([
            ["name", "offsetY (dp)", "blur (dp)", "tint"],
            ...manifest.tokens.elevation.map((e) => [`\`${e.name}\``, e.offsetY.toString(), e.blur.toString(), `\`${e.tintName}\``]),
          ]));
        } else if (category === "typography") {
          lines.push(mdTable([
            ["name", "size (sp)", "lineHeight (sp)", "weight", "family"],
            ...manifest.tokens.typography.map((t) => [`\`${t.name}\``, t.sizeSp.toString(), t.lineHeightSp.toString(), t.weight, t.family]),
          ]));
        } else {
          // spacing | radius | borderWidth | iconSize — all DimensionToken
          const items = manifest.tokens[category];
          lines.push(mdTable([
            ["name", "dp", "comment"],
            ...items.map((d) => [`\`${d.name}\``, d.dp.toString(), d.comment ?? ""]),
          ]));
        }
    
        return { content: [{ type: "text", text: withFooter(manifest, lines.join("\n")) }] };
      },
    };
  • The inputSchema for list_tokens, defining an optional 'category' property with an enum of valid token categories.
    inputSchema: {
      type: "object",
      properties: {
        category: {
          type: "string",
          enum: ALL_CATEGORIES,
          description: "Token category to expand. Omit for a summary across all categories.",
        },
      },
      additionalProperties: false,
    },
  • The tool registry where listTokensTool is listed in the tools array, making it available for dispatch.
    export const tools: ToolDef[] = [
      listComponentsTool,
      getComponentTool,
      listTokensTool,
      searchIconsTool,
      getIconTool,
      getChangelogTool,
      lookupFigmaNodeTool,
      searchTool,
      getAurumVersionTool,
    ];
  • The import statement that pulls listTokensTool into the tool registry.
    import { listTokensTool } from "./list-tokens.js";
Behavior4/5

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

No annotations are provided, but the description discloses key behaviors: the tool returns a summary with counts when category is omitted, and a full table when a category is provided. This adds behavioral context beyond the schema, though no mention of pagination, rate limits, or performance implications.

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

Conciseness5/5

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

Two sentences, front-loaded with the core purpose, and no extraneous information. Every word earns its place.

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?

Given the tool's simplicity (1 optional enum parameter, no output schema, no annotations), the description covers the essential behavioral aspects. It explains both use cases and the structure of the response implicitly. Could be improved by briefly describing the output format, but the context signals indicate no output schema, so the burden is on the description.

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 100% with an enum and description. The description adds value by explaining the semantic difference between omitting the parameter (summary) and providing it (detailed table), which is not present in the schema's description.

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?

Description clearly states the tool lists Aurum design tokens by category, enumerating the categories and distinguishing between summary (omit category) and detailed listing (pass category). This verb+resource+scope is specific and distinct from siblings.

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?

Explicitly tells when to omit category for a summary and when to pass a category for full table, providing clear action guidance. No mention of alternatives, but the tool is self-contained and the instructions are sufficient.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/atri-jar/aurum-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server