Skip to main content
Glama

get_violations

Identify hardcoded token values in source code and get suggestions for replacing them with design tokens. Filter by category such as colors or spacing.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNo
Behavior5/5

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

Discloses read-only nature and no side effects. Describes the return structure in detail: JSON with count, suggestion-coverage stats, and list items with file:line:column, literal, utility, and optional smart-match suggestion. No annotations exist, so description carries full burden.

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?

Concise yet comprehensive: the description is a few dense sentences with no unnecessary words. Information is front-loaded (verb + resource in the first phrase) and logically organized.

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 and zero schema description coverage, the description fully compensates by detailing the output structure, parameter usage, and calling context. It also guides the agent on when to use sibling tools, making the description complete for effective tool selection.

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?

The schema has 0% description coverage, but the description explicitly explains the category parameter, listing the valid enum values ('all', 'colors', 'spacing') and noting that hardcoded values are only detected for these categories. This adds crucial semantic 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?

Clearly states 'Get hardcoded token values' with a specific description of what constitutes hardcoded values (literals typed inline). Distinguishes itself implicitly by focusing on violations against design tokens, while sibling tools handle other aspects like component info or token retrieval.

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 advises when to call: 'Call this BEFORE generating UI with literal values.' Also provides filtering guidance for the category parameter and directs to alternative tools (get_design_context or get_token) for available tokens.

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

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