Skip to main content
Glama

get_violations

Read-only

Detect hardcoded color and spacing values in your codebase, returning file locations and suggested design tokens to use instead.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.2
    • removedInput schema / required
      Removed value: -[
      -  "category"
      -]
  2. Addedv1.8.0

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.