Skip to main content
Glama

Emit tokens

kaava_emit
Idempotent

Writes the design system out to your project as CSS variables, Tailwind v4 theme, SCSS, TypeScript, W3C tokens, DESIGN.md, or a preview, and remembers the chosen targets for regeneration.

Instructions

Write the design system out for the project stack. Targets: "css" (custom properties, works with any framework), "tailwind" (Tailwind v4 @theme), "scss", "ts" (typed token object for React/Vue/Svelte/React Native), "dtcg" (W3C design tokens JSON for Figma/Style Dictionary), "design-md" (DESIGN.md in the open DESIGN.md format: tokens as YAML front matter plus usage rules, for agents and people), "preview" (self-contained preview.html showing the system in use, for the user to open in a browser). The choice is remembered, so later kaava_update_system calls regenerate the same files.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "targets": "<targets>"
    },
    "name": "kaava_emit"
  }
}

Input Schema

NameRequiredDescriptionDefault
dryRunNoReturn the content that would be written instead of writing files.
outDirNoDirectory relative to the project root. Default: the directory used last time, else "kaava".
targetsYesWhich outputs to write.
overwriteNoReplace existing files in outDir that Kaava did not generate. Without this, such files are left untouched and the call fails.
projectRootNoAbsolute path of the project. Defaults to the first workspace root the client exposes, else the server working directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is carried structurally. The description adds genuinely new behavioral context: files are written to disk, formats target specific ecosystems, and the target choice is persisted and reused by later updates. It is silent on overwrite risk and on what a successful call returns, but the overwrite semantics are covered by the schema.

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 core action, then a single dense enumeration where every clause carries distinct information. The one long run-on sentence describing the targets is information-dense but heavy to parse; a list would read better without adding length.

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 5-parameter generation tool with no output schema, the description covers what is produced, for which stacks, and how the choice persists across calls. Remaining gaps are the return value (file paths? written content?) and failure semantics when targets partially write, though dryRun and outDir defaults are already fully documented in the schema.

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 100%, so the baseline is 3. The description does add real meaning beyond the bare enum by explaining what each target produces (e.g. 'tailwind' means Tailwind v4 @theme, 'dtcg' means W3C design tokens JSON for Figma/Style Dictionary), but it says nothing about dryRun, outDir, projectRoot or overwrite, which the schema handles on its own.

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?

Specific verb (write out) plus resource (the design system) plus eight named output formats with a one-clause purpose for each. It is immediately distinguishable from kaava_get_tokens (reads tokens) and kaava_update_system (mutates the system rather than emitting files).

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 selection context: the target list doubles as guidance on which format fits which stack, and the final sentence explains that the choice persists so subsequent kaava_update_system calls regenerate the same files. It stops short of explicit exclusions (e.g. 'does not modify tokens' or 'use kaava_get_tokens for in-memory reads').

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