design-data-agent-mcp

v1.17.0
@adobe/design-data-agent-mcp Checked 2 hours ago Published 1 day ago

MCP server and Claude Code skill for the design-data agent surface — read tools run in-process via wasm

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

primer

Load the design data primer: full token taxonomy, resolved values, component list, and field definitions. Call this at the start of an agent session.

resolve_token

Resolve a design token property to its final value for a given context. Use component, variant, state, or colorRole to disambiguate shared properties; inspect ambiguous and deprecated in the result.

ParameterTypeDescription
property *stringBare token property name (the name.property segment, e.g. "background-color", "corner-radius" — see primer().properties for the full list). Not a flattened legacyKey.
colorRolestringOptional color role such as accent, negative, or positive.
colorSchemestringColor scheme: light or dark
componentstringOptional component name-object field. It is sparsely populated; prefer variant, state, or colorRole when available.
contraststringContrast: regular or high
excludeDeprecatedbooleanExclude tokens with lifecycle.deprecatedIn from candidate resolution.
scalestringScale: desktop or mobile
statestringOptional token state used to narrow shared properties (including array-valued state).
variantstringOptional token variant used to narrow shared properties.

query_tokens

Query design tokens using a filter expression. Returns matching token entries; alias tokens add `value` (the token's own resolved value in its own mode), and `chain` with view=full.

ParameterTypeDescription
filter *stringFilter expression, e.g. "property=background-color". Valid keys: property, component, variant, state, colorScheme, scale, contrast, uuid, $schema, tier (primitive, semantic or component), object, anat…
viewstringcompact (default) adds an alias token's own resolved value (in its own mode; default modes where it is multi-mode); full also adds the alias `chain`. Composite values are not shown.

suggest_token

Suggest Spectrum tokens matching a natural-language intent using Jaccard similarity scoring over token name segments, name-object fields, and description text. Returns matches ranked by confidence with token name, layer, value, and name object. Use when the user describes what they need rather than knowing the token name.

ParameterTypeDescription
intent *stringNatural-language description of the design need, e.g. "primary CTA button background color"
limitnumberMaximum number of suggestions to return (default: 5)
viewstringcompact (default) adds an alias token's own resolved value (in its own mode; default modes where it is multi-mode); full also adds the alias `chain`. Composite values are not shown.

token_refinements

Show a token's semantic specificity (tier, then purpose-field count, derived from its name) and the same-property tokens that are narrower (add purpose fields) or broader (drop them). Each neighbor lists `fields` it adds or lacks and a `valueMatch`: "drop-in" (same value in every mode) or "consider" (differs; see `differingModes`). Specificity only orders tokens; check the added fields fit the use before swapping.

ParameterTypeDescription
token *stringToken name (e.g. neutral-content-color-hover), uuid or conceptId. The older field text, such as `property=corner-radius scaleIndex=500`, is also accepted.
limitnumberMaximum narrower and broader tokens, each (default: 10)

describe_component

Return the JSON schema and token relationships (bindings) for a design system component by its ID.

ParameterTypeDescription
id *stringComponent ID, e.g. button

describe_guideline

Return the full documentBlocks content and metadata for a Spectrum design guideline by its slug ID — the read-back counterpart to data_create/data_edit for the guidelines category. Guideline IDs are kebab-case, e.g. colors, motion, typography-fundamentals.

ParameterTypeDescription
id *stringGuideline ID (kebab-case slug), e.g. colors, motion

list_guidelines

List available Spectrum design guidelines and their metadata. Optionally filter the catalog by category before calling describe_guideline.

ParameterTypeDescription
categorystringOptional guideline category, e.g. designing or implementing

validate_usage

Validate design token usage in a dataset. Runs Layer-1 JSON-Schema structural validation and Layer-2 relational rules. Returns a JSON report of violations and warnings.

ParameterTypeDescription
pathstringPath to dataset to validate (defaults to DESIGN_DATA_PATH)
schema_pathstringPath to schemas directory containing token-types/ and token-file.json. Defaults to the @adobe/design-data-spec schemas. Set DESIGN_DATA_SCHEMAS env var or pass explicitly for custom schema sets.
strictbooleanTreat warnings as errors

diff_datasets

Compare two design data datasets and return a JSON diff of added, removed, and changed tokens.

ParameterTypeDescription
newPath *stringPath to the new/updated dataset
oldPath *stringPath to the old/baseline dataset
filterstringOptional filter expression to narrow results

write

Write agent-generated design context to the dataset (e.g. product-context.json). Returns a confirmation message.

ParameterTypeDescription
outputstringOutput file path (defaults to product-context.json inside DESIGN_DATA_PATH)
rationalestringRationale or summary to embed in the written file

start_authoring_session

Start a new token authoring session. Returns a session_id and the initial wizard state. The session persists across calls — use the returned session_id in subsequent steps.

ParameterTypeDescription
dataset_pathstringPath to the token dataset directory. Defaults to DESIGN_DATA_PATH.

authoring_session_step_intent

Update the intent for a session and get ranked existing-token suggestions. Returns suggestions and can_alias (true when a high-confidence match exists).

ParameterTypeDescription
intent *stringNatural-language description of what the token is for, e.g. 'accent background color'.
session_id *string

authoring_session_step_classification

Set the layer, property, and name-object fields for the token. name_fields is an array of {key, value} objects. Classification is validated against the active fields catalog.

ParameterTypeDescription
layer *stringToken layer.
property *stringToken property, e.g. 'background-color'.
session_id *string
name_fieldsarrayAdditional name-object fields beyond property.

authoring_session_step_values

Set the value rows for the token. Each row specifies mode conditions and either a literal value or an alias target. Most tokens need one row with empty mode_combo.

ParameterTypeDescription
rows *arrayValue rows. Each: { mode_combo: [[key,val],...], kind: 'Literal'|'Alias', alias_target: string, literal: string }
session_id *string

authoring_session_commit

Build and write the token to disk as a cascade array element, then remove the session. Requires schema_url (the JSON Schema URL for the token type) and target (the *.tokens.json cascade file to write into).

ParameterTypeDescription
schema_url *stringThe $schema URL for the token type, e.g. https://opensource.adobe.com/spectrum-design-data/schemas/token-types/color.json
session_id *string
target *stringTarget *.tokens.json cascade file to write into (created if absent, upserted if present).
is_overridebooleanTrue when this token overrides an existing foundation/platform token.
product_contextstringPath to product-context.json for rationale capture.
rationalestringWhy this token is being created.
schema_pathstringPath to schemas directory containing token-types/ and token-file.json. Defaults to the @adobe/design-data-spec schemas when omitted.

authoring_session_cancel

Cancel a session and delete its on-disk file.

ParameterTypeDescription
session_id *string

authoring_session_get

Get the current state of an authoring session.

ParameterTypeDescription
session_id *string

authoring_session_list

List all active authoring sessions.

edit_token

Merge field updates into an already-committed cascade token, then re-validate. The token's uuid is always preserved and silently ignored if included in updates.

ParameterTypeDescription
target *stringPath to the *.tokens.json cascade file containing the token.
updates *objectFields to merge into the token object, e.g. { "value": "#ff0000" }.
uuid *stringUUID of the token to edit.
rationalestringWhy the token changed.
schema_pathstringSchemas directory for validation (default: auto-resolved from target).
tokens_rootstringRoot tokens directory — required when updates contains a $ref.

deprecate_token

Stamp a deprecation marker onto a cascade token. Optionally record a replacement UUID and a planned-removal spec version.

ParameterTypeDescription
spec_version *stringDataset specVersion string to stamp into the deprecated value, e.g. '1.0.0'.
target *stringPath to the *.tokens.json cascade file containing the token.
uuid *stringUUID of the token to deprecate.
deprecated_commentstringHuman-readable deprecation explanation / migration guidance.
planned_removalstringSpec version at which the token will be removed.
rationalestringWhy the token was deprecated.
replaced_bystringReplacement token UUID (string) or JSON array of UUIDs.
schema_pathstringSchemas directory for validation.

rename_token

Assign a new name object to a cascade token, preserving its UUID. Optionally set a replaced_by pointer on the token being renamed.

ParameterTypeDescription
new_name *New name — either a JSON object ({"property":"…","component":"…"}) or a plain string.
target *stringPath to the *.tokens.json cascade file containing the token.
uuid *stringUUID of the token to rename.
rationalestringWhy the token was renamed.
replaced_by_targetstringUUID to set as the replaced_by pointer (for retiring the old name).
schema_pathstringSchemas directory for validation.

rewire_alias

Change the $ref target on an alias token. The new ref target must resolve in the cascade. Rejects if the token is not an alias.

ParameterTypeDescription
new_ref *stringNew $ref value — must be a UUID that resolves in the cascade.
target *stringPath to the *.tokens.json cascade file containing the token.
tokens_root *stringRoot tokens directory for ref-resolution verification.
uuid *stringUUID of the alias token to rewire.
rationalestringWhy the alias target changed.
schema_pathstringSchemas directory for validation.

remove_token

Delete a token from a cascade file. Aborts if any other token in the dataset holds a $ref pointing at this token's UUID.

ParameterTypeDescription
target *stringPath to the *.tokens.json cascade file containing the token.
tokens_root *stringRoot tokens directory for inbound-reference guard.
uuid *stringUUID of the token to remove.

add_mode

Append a new mode to an existing mode-set file.

ParameterTypeDescription
mode *stringName of the new mode to add.
mode_set_file *stringPath to the mode-set JSON file.
make_defaultbooleanMake this the default mode.

rename_mode

Rename a mode in a mode-set file and propagate the change to all token files under tokens_root that use that mode value.

ParameterTypeDescription
mode_set_file *stringPath to the mode-set JSON file.
new *stringReplacement mode name.
old *stringExisting mode name to rename.
tokens_root *stringRoot tokens directory for propagation.

remove_mode

Remove a mode from a mode-set file. Aborts if any token references that mode value or if the mode is the current default.

ParameterTypeDescription
mode *stringMode name to remove.
mode_set_file *stringPath to the mode-set JSON file.
tokens_root *stringRoot tokens directory for reference guard.

create_mode_set

Author a new mode-set file for a new cascade dimension. The file must not already exist. default must be a member of modes.

ParameterTypeDescription
default *stringDefault mode — must be a member of modes.
mode_set_file *stringDestination path for the new mode-set JSON file (must not exist).
modes *arrayOrdered list of mode names, e.g. ['light', 'dark'].
name *stringLogical name used as the key in token name objects, e.g. 'colorScheme'.
descriptionstringHuman-readable description embedded in the file.

remove_mode_set

Delete a mode-set file. Aborts if any token in the dataset references this dimension.

ParameterTypeDescription
mode_set_file *stringPath to the mode-set JSON file to remove.
tokens_root *stringRoot tokens directory for reference guard.

data_create

Create a new non-token data object (component, field, registry entry, mode-set, or guideline). Validates the JSON document against the category schema before writing. Fails if the file already exists — use data_edit to overwrite.

ParameterTypeDescription
category *stringData category to create in.
document *objectFull JSON document to write. Must include the category's required fields (e.g. `name`, `$schema`, `specVersion`). The filename is derived from the `name` field.
datasetstringPath to the dataset root (packages/design-data). Defaults to DESIGN_DATA_PATH minus /tokens.
spec_schemasstringPath to the design-data-spec schemas dir. Defaults to DESIGN_DATA_SPEC_SCHEMAS or auto-probed.

data_edit

Replace an existing non-token data object with a new JSON document. Validates the document against the category schema before writing. Fails if the file does not exist — use data_create to create it. Edit is a full document replace, not a patch.

ParameterTypeDescription
category *stringData category to edit in.
document *objectFull replacement JSON document. The `name` field must match the existing file.
datasetstringPath to the dataset root (packages/design-data). Defaults to DESIGN_DATA_PATH minus /tokens.
spec_schemasstringPath to the design-data-spec schemas dir. Defaults to DESIGN_DATA_SPEC_SCHEMAS or auto-probed.