Skip to main content
Glama

generate_code

Generate React code from a saved design spec, writing shadcn/ui and Tailwind components into atomic design folders. Validates against design tokens and quality gates, with option to force write after review.

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 an AI provider is configured — 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 fully bears the burden of behavioral disclosure. It details the return object (entryFile, files, findings, critique), error conditions (specName not found, quality-gate blocking), and the effect of force:true. It also notes that critique is informational and does not block. This is fairly comprehensive.

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 concise with three focused sentences: action and folder structure, return value, and error handling. It is front-loaded with the main purpose. Minor waste: the phrase 'informational only, never blocks' is slightly redundant with earlier 'critique is an AI layout score... — informational only, never blocks.' Overall efficient.

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 no output schema, the description adequately explains the return object, error states, and the critique's nature. It covers quality-gate findings and force override. However, it does not specify the exact format of 'files[]' or 'findings', which could be useful for an agent. Still, it is largely complete for a code generation tool.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. The description repeats the schema's parameter descriptions without adding new semantics (e.g., specName is case-sensitive and must match get_specs output; force is for overriding findings). No additional context is provided beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 saved spec and writes to atomic design folders. It uses a specific verb and resource, distinguishing it from sibling tools like get_spec or create_spec, though it could more explicitly contrast with them.

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: it generates code from a saved spec, with errors for missing specName and quality-gate findings. It mentions force:true for override but does not explicitly state when to use this tool versus alternatives like scaffold_swiftui_files or other code generation tools.

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

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