Skip to main content
Glama

Primitiv

The design system contract keeping teams and agents in sync.

Retrieval gives you data. Reconciliation gives you truth.

The problem

Design-system knowledge is spread across code, Figma, Storybook, and documentation. When those sources drift, people reconcile the differences through experience; AI coding agents often fall back to generic patterns that work but do not belong in the product.

Primitiv gives every agent the same current design context through a machine-readable contract and a read-only MCP interface. It helps agents reuse what exists, follow established decisions, and surface inconsistencies before they ship.

Primitiv runs locally. Your code never leaves your machine.

Related MCP server: Figma MCP Server by Bao To

Quick start

Run these commands from your project root:

npx @ai-by-design/primitiv init
npx @ai-by-design/primitiv build
npx @ai-by-design/primitiv serve

init sets up Primitiv for the current project, build creates its design contract, and serve makes that contract available to MCP-compatible agents.

See the Primitiv documentation for installation, configuration, commands, and integration guides.

IMPORTANT

Keep Primitiv configured at project level. A global MCP configuration can serve the wrong project's contract when you switch repositories.

Capabilities

  • Bring design context from your codebase, Figma, and Storybook together

  • Make existing tokens, components, rules, and rationale available to agents

  • Surface conflicts, drift, and hardcoded token misuse

  • Provide read-only access from MCP-compatible agents and editors

  • Verify that the contract stays current in CI

Available Tools

6 tools
get_componentA
Read-only

Look up a component by name or id. Read-only, no side effects. Pass context (your current working file or directory) so same-name components resolve by path scope. Returns the component JSON (with its id) when the lookup resolves to exactly one component, or an error listing available names if not found. Detail is opt-in: pass 'api' for the component's declared prop contract, 'usage' for static JSX-site counts and observed prop values, 'relationships' for sorted outgoing uses and derived incoming usedBy counts, or 'all' for every projection. These are static source-site facts, never runtime frequency. When several components share the name and neither governance nor scope decides, returns { ambiguous, matches, instruction } — follow the instruction: match each candidate's rationale.when against the user's intent, and if that doesn't decide, ask the user; never pick arbitrarily. Use this when you need implementation details for a known component to reuse it rather than recreate it. For a list of all components, use get_design_context with category 'components' instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
detailNo
contextNo

TDQS

A5/5.0
Behavior5/5

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

Even though the readOnlyHint annotation already signals safety, the description goes well beyond it by disclosing exact resolution behavior: same-name resolution by context path scope, error behavior when not found, the meaning of each detail projection, and the static-source-facts caveat. It also precisely describes the ambiguous-match response shape with { ambiguous, matches, instruction } and instructs the agent to follow the instruction rather than pick arbitrarily.

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?

The description is dense but every sentence adds distinct value: purpose, read-only guarantee, context semantics, return behavior, detail options, static facts caveat, ambiguity protocol, and usage alternative. It is front-loaded with the core lookup purpose and then layers essential behavioral details without redundancy.

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?

Given there is no output schema, the description thoroughly explains return values, error cases, ambiguity handling, and parameter behaviors. It covers all necessary contingencies for correct invocation and interpretation, including how to disambiguate by rationale.when and when to ask the user. The description is complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden, and it succeeds. It explains that 'name' can be either a name or id, that 'context' is used for path-scoped resolution of same-name components, and it defines each enum value of 'detail' with concrete projections. This adds substantial meaning beyond the bare schema types and enum list.

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?

The description clearly states the tool looks up a component by name or id, with an explicit read-only guarantee. It differentiates itself from the sibling get_design_context by noting that the sibling provides the list of all components. The verb 'look up' plus the resource 'component' makes the purpose unmistakable.

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?

The description gives explicit when-to-use guidance: use this tool when you need implementation details for a known component to reuse rather than recreate it. It also names the alternative get_design_context for listing all components, preventing misuse. The ambiguity-resolution instructions further guide the agent on what to do when lookup returns multiple matches.

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

get_conflictsA
Read-only

Get conflicts between design sources. Read-only, no side effects. Returns JSON with conflict count, actionable count, and a list of conflicts with type, name, resolution status, and suggested fixes. Pass type: 'all' | 'token' | 'component' (default 'all'). Pass status: 'all' | 'pending' | 'resolved' (default 'pending'). Use this to audit disagreements between sources (e.g. Figma vs codebase). For resolved design values, use get_token or get_component instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNo
statusNo

TDQS

A5/5.0
Behavior5/5

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

Despite having readOnlyHint, description adds behavior details: read-only nature, output structure (JSON with conflict count, actionable count, list with fields), and parameter defaults. No contradiction.

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?

Description is compact and well-organized: action, behavior, output, parameters, and usage guidance all covered in 3 sentences without redundancy or unnecessary detail.

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?

Comprehensive for a tool with 2 optional params and no output schema: explains purpose, output shape, parameter semantics, and alternatives. No missing critical information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema only provides type/status as strings without descriptions. Description fully explains allowed values ('all'|'token'|'component', 'all'|'pending'|'resolved') and defaults (all), compensating for schema gaps.

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?

Clearly states the tool returns conflicts between design sources, with a specific verb and resource. Differentiates from siblings by explicitly directing resolved-value lookups to get_token/get_component.

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 states when to use (audit disagreements between sources) and when not to (for resolved values, use other tools). Provides context with example (Figma vs codebase).

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

get_design_contextA
Read-only

Get the resolved design system context before building UI. Read-only, no side effects. Default (no category) returns a JSON summary of token counts, component names, conflict counts, and contract metadata. Pass category: 'all' | 'tokens' | 'components' | 'conflicts' to get full detail. Pass tokenCategory to filter tokens: colors, spacing, sizes, typography, borderRadius, shadows, zIndex, breakpoints, motion (unknown/aliased categories return an actionable error, not a silent empty result). Use this as the first call to understand what exists. For lookups by name, use get_token or get_component instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo
tokenCategoryNo

TDQS

A4.9/5.0
Behavior5/5

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

Annotation readOnlyHint is reinforced and expanded with 'no side effects' and details about error behavior for unknown categories, adding value beyond annotations. No contradiction.

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?

The description is dense and structured, front-loading purpose with subsequent sentences adding detail. Slightly verbose but each clause carries useful info.

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?

Given no output schema, it describes the default summary output and category-specific detail, including error handling for unknown categories, making it complete for the agent to assess its use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so description fully compensates by explaining category values ('all', 'tokens', 'components', 'conflicts') and tokenCategory list, plus behavior for valid and invalid inputs.

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?

The description clearly states the tool gets the resolved design system context, distinguishes it from lookups by name with 'For lookups by name, use get_token or get_component instead.'

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 says to use this as the first call to understand what exists, and names alternatives for specific lookups, providing clear context for when to use versus not.

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

get_inferred_rulesA
Read-only

Get the design rules inferred from your codebase patterns. Read-only, no side effects. Returns JSON with a list of rules including category, pattern, and confidence, or an error if no rules have been generated yet. Pass category to filter: spacing, colors, typography, borderRadius, naming, components. Omit category to get all. Use this to understand implicit conventions the codebase follows. For explicit design token values, use get_token. For source conflicts, use get_conflicts.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo

TDQS

A4.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description repeats that fact. It adds useful behavioral context beyond the annotation: returns a JSON list with category/pattern/confidence, errors if no rules have been generated, and supports filtering by category.

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?

The description is dense but front-loaded, with every sentence adding value: purpose, safety, return shape, filter usage, and alternative tools. No wasted words or repetition of schema-only details.

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?

The tool is simple (one optional parameter, no output schema), and the description covers the return format, error case, filter values, and usage context. It is fully adequate for correct tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description fully compensates by enumerating exact accepted values: spacing, colors, typography, borderRadius, naming, components. It also explains that omitting the parameter returns all rules.

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?

The description uses a specific verb and resource: "Get the design rules inferred from your codebase patterns." It clearly differentiates from siblings by naming get_token and get_conflicts as alternatives for other intents.

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 states when to use the tool ("understand implicit conventions") and provides exclusions: "For explicit design token values, use get_token. For source conflicts, use get_conflicts." Also explains category filtering and omission behavior.

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

get_tokenA
Read-only

Look up a specific design token by name. Read-only, no side effects. Returns the token's name, value, and category, or an error if not found. Pass category to narrow search: colors, spacing, sizes, typography, borderRadius, shadows, zIndex, breakpoints, motion (aliases like 'color'/'radius'/'z-index' are normalized). Omit category to search all. Use this when you know the token name. For a broad overview of all tokens, use get_design_context with category 'tokens' instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
categoryNo

TDQS

A4.6/5.0
Behavior4/5

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

Although annotations already declare readOnlyHint=true, the description adds meaningful behavioral detail: 'Read-only, no side effects,' explains the return value, and discloses the error condition when the token is not found. It also explains alias normalization for categories, which goes beyond the annotation.

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?

The description is composed of three well-structured sentences, with the primary action and read-only guarantee front-loaded, followed by return/error behavior, then category semantics and sibling-tool guidance. Each sentence earns its place, though the category-alias list makes it slightly denser than strictly necessary.

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?

For a simple two-parameter look-up tool, the description is complete: it covers input semantics, return behavior, error outcome, category normalization, and alternative tool usage. No output schema is present, but the description explicitly lists what the return contains and the error case, so the agent can predict behavior.

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?

The input schema has zero description coverage, so the description carries the full burden of explaining parameters. It explains that 'name' is the token name to search for and 'category' narrows the search, listing all valid categories and alias normalization behavior. This adds substantial meaning beyond the raw schema.

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?

The description clearly states the tool's purpose: 'Look up a specific design token by name' and specifies the exact resource (design tokens), the return value, and the error behavior. It is distinguished from sibling tools like get_design_context by explicitly targeting single-token lookup vs broad overview.

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?

The description gives clear when-to-use guidance: 'Use this when you know the token name.' It also provides an explicit alternative for a different use case: 'For a broad overview of all tokens, use get_design_context with category 'tokens' instead.' This is model guidance for tool selection.

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

get_violationsA
Read-only

Get hardcoded token values: literals in source code typed inline instead of referencing a design token, bypassing the contract. Read-only, no side effects. Returns JSON with a count, suggestion-coverage stats, and a list with file:line:column, the captured literal, the surrounding utility (e.g. 'bg-[#ff0000]'), and an optional smart-match suggestion when a contract token has the same value. Pass category to filter: 'all' | 'colors' | 'spacing' (hardcoded values are only detected for these). Call this BEFORE generating UI with literal values — prefer the suggested token over a hardcoded literal. For available tokens to use instead, use get_design_context or get_token.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo

TDQS

A5/5.0
Behavior5/5

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

The description states 'Read-only, no side effects,' which aligns with and expands on the readOnlyHint annotation. It additionally discloses return structure, filtering behavior, and the fact that hardcoded values are only detected for certain categories. This provides rich behavioral context beyond the annotation.

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?

The description is efficiently structured: it defines the topic, states safety, summarizes output, explains the parameter, and gives usage guidance. No sentence is wasted; it remains readable while packing substantial 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?

Even without an output schema, the description thoroughly details the return JSON structure (count, suggestion-coverage stats, list with file:line:column, literal, utility, smart-match suggestion). It covers the parameter, use cases, and alternatives, making the tool fully understandable for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining that the `category` parameter filters results and lists allowed values ('all' | 'colors' | 'spacing'), also noting why these categories matter. This adds essential meaning not present in the schema.

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?

The description clearly states the tool's function: getting hardcoded token values (literals in source code instead of design tokens). It distinguishes itself from siblings by explicitly referencing get_design_context and get_token as alternatives for available tokens, and by describing its specific output related to violations.

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?

The description provides explicit usage guidance: 'Call this BEFORE generating UI with literal values — prefer the suggested token over a hardcoded literal.' It also names alternative tools for token lookup, giving clear when-to-use vs. when-not-to-use direction.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev2.15.0
    • Changedget_component1 field changed
      • addedInput schema / properties / detail
        Added value: +{
        +  "enum": [
        +    "api",
        +    "usage",
        +    "relationships",
        +    "all"
        +  ],
        +  "type": "string"
        +}
  2. 5 tool updatesv2.1.2
    • Changedget_conflicts1 field changed
      • removedInput schema / required
        Removed value: -[
        -  "type",
        -  "status"
        -]
    • Changedget_design_context1 field changed
      • removedInput schema / required
        Removed value: -[
        -  "category",
        -  "tokenCategory"
        -]
    • Changedget_inferred_rules1 field changed
      • removedInput schema / required
        Removed value: -[
        -  "category"
        -]
    • Changedget_token1 field changed
      • changedInput schema / required
        Previous value: -[
        -  "name",
        -  "category"
        -]New value: +[
        +  "name"
        +]
    • Changedget_violations1 field changed
      • removedInput schema / required
        Removed value: -[
        -  "category"
        -]
  3. 1 tool updatev2.0.0
    • Changedget_component1 field changed
      • addedInput schema / properties / context
        Added value: +{
        +  "type": "string"
        +}
  4. 6 tool updatesv1.8.0
    • Addedget_component
    • Addedget_conflicts
    • Addedget_design_context
    • Addedget_inferred_rules
    • Addedget_token
    • Addedget_violations
  5. 5 tool updatesv1.6.0
    • Removedget_component
    • Removedget_conflicts
    • Removedget_design_context
    • Removedget_inferred_rules
    • Removedget_token
  6. 5 tool updates
    • First observedget_component
    • First observedget_conflicts
    • First observedget_design_context
    • First observedget_inferred_rules
    • First observedget_token

TDQS

A4.9/5.0
Disambiguation5/5

Each tool targets a distinct aspect of the design system: components, conflicts, context summary, inferred rules, tokens, and violations. No overlap in purpose.

Naming Consistency5/5

All tools follow a consistent `get_<noun>` pattern with snake_case, making the API predictable and easy to navigate.

Tool Count5/5

Six tools is appropriate for a read-only design system inspector, covering all key areas without being excessive or insufficient.

Completeness5/5

The tool set provides comprehensive read-only access to design system components, tokens, rules, conflicts, violations, and context. No obvious gaps for its intended purpose.

Maintenance

ActivityActive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that exposes your design system components and tokens to AI agents, preventing duplicate component creation and hardcoded token values.
    18
    9
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to extract design systems, analyze components, and maintain design-code consistency from Figma files, providing intelligent component analysis and accessibility compliance.
    156
    30
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Converts Figma designs into structured code context with token-aware styling, enabling AI agents to generate production-level frontend code.
    1
    14
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Provides deterministic, read-only design knowledge for AI coding agents to help them choose visual directions, plan UI states, and compose design tokens, all without network access.
    6
    29
    4
    MIT

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/AI-by-design/primitiv'

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