Skip to main content
Glama

generate_code

Generate shadcn/ui and Tailwind React components from a design spec, writing files into atomic design folders. Includes optional AI layout scoring.

Instructions

Generate shadcn/ui + Tailwind code from a saved spec and write files into atomic design folders (atoms → components/ui/, molecules/organisms/templates → components//).

Returns: { entryFile, files[], generatedAt, findings[], critique? }. For page specs, critique is an AI layout score (0-100) + hierarchy/spacing/consistency notes when ANTHROPIC_API_KEY is set — informational only, never blocks. Errors: isError if specName is not found. isError with { blocked: true, findings } if a critical quality-gate finding (raw hex/color when tokens exist, a token-pair contrast failure, or a strict-mode skill-compliance violation) prevented the write — pass force:true to write anyway after reviewing the findings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoSet true to write files despite critical quality-gate findings. Only pass this after reviewing the findings and intentionally deciding to override them.
specNameYesName of the spec to generate code for (case-sensitive, must match a spec returned by get_specs).
Behavior4/5

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

With no annotations, the description carries full burden. It details the return structure (entryFile, files, findings, critique), error behaviors (specName not found, blocked on critical findings), and the force override. It also clarifies the critique is informational and never blocks. However, it does not cover all potential behavioral traits like rate limits or partial write handling.

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 well-structured, starting with the main purpose, then detailing return and error cases. Every sentence adds value, but it could be slightly more concise by combining some lines. Overall, it is appropriately sized for the tool's complexity.

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?

Given the tool's complexity (generation with atomic design, critique, quality gates) and no output schema, the description covers purpose, return structure, error modes, and override behavior. It explains critique conditions and that errors can be overridden with force. Minor missing details like specific folder mapping criteria, but sufficient for an agent.

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?

Schema coverage is 100%, so baseline is 3. The description adds significant meaning: it explains force should only be used after reviewing findings, and specName is case-sensitive and must match get_specs output. This adds context beyond 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 generates code from a spec and writes files into atomic design folders with specific folder mappings. It uses a specific verb and resource, and distinguishes itself from siblings like get_specs or analyze_design by describing its unique output and behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a saved spec and want to generate code, and explains error conditions and the force parameter. However, it lacks explicit guidance on when not to use this tool versus alternatives (e.g., when only analyzing design). The inclusion of critique and quality gates provides context but no direct exclusions.

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/sarveshsea/memi'

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