Skip to main content
Glama

create_spec

Define or update design system specifications for components, pages, or data visualizations with JSON validation before saving to the local registry.

Instructions

Create or overwrite a spec in the local registry. Validates against Zod schemas before saving.

Prerequisites: None. The spec body must be valid JSON. If a spec with the same name already exists, it is silently overwritten.

Returns on success: Plain confirmation string Spec "<name>" saved (<type>).

Error behavior: Returns isError with Zod validation error details if the spec body doesn't match the schema. Returns isError for JSON parse failures or unknown type values.

Spec type schemas:

  • "component": Must include name, type="component", atomicLevel ("atom"|"molecule"|"organism"|"template"), purpose, props[], variants[], composesSpecs[], codeConnect{}. Atoms must have composesSpecs=[].

  • "page": Must include name, type="page", purpose, sections[].

  • "dataviz": Must include name, type="dataviz", chartType, dataShape.

Use this tool: to define a new component before calling generate_code, or to update an existing spec's props or variants. Always call get_specs first to avoid accidentally overwriting an existing spec.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesJSON string of the full spec object. Must include a 'type' field ('component', 'page', or 'dataviz') and all required fields for that spec type. Zod validation errors are returned as structured error messages if the shape is invalid.
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels. It discloses critical behavioral traits: silent overwriting of existing specs, validation requirements, error behavior (Zod validation errors, JSON parse failures), return format on success, and detailed spec type schemas. This goes well beyond basic functionality description.

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 with clear sections (purpose, prerequisites, returns, errors, schemas, usage). While somewhat lengthy, every sentence earns its place by providing essential information. It could be slightly more concise in the schema listing, but overall it's efficiently organized with front-loaded key 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?

For a mutation tool with no annotations and no output schema, the description provides exceptional completeness. It covers purpose, prerequisites, success behavior, error behavior, detailed parameter requirements, and usage guidelines. The spec type schemas section is particularly thorough, compensating for the lack of structured output schema.

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 100% description coverage, so the baseline is 3. The description adds significant value by explaining what the 'spec' parameter must contain ('JSON string of the full spec object'), detailing the three possible spec types with their required fields, and emphasizing validation requirements. This provides crucial semantic context beyond the schema's technical description.

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 with specific verbs ('Create or overwrite a spec in the local registry') and distinguishes it from siblings by specifying it's for defining/updating specs before generate_code. It explicitly mentions validation against Zod schemas, which adds specificity beyond a generic create operation.

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 guidance on when to use this tool ('to define a new component before calling generate_code, or to update an existing spec's props or variants') and when to avoid misuse ('Always call get_specs first to avoid accidentally overwriting an existing spec'). It also references sibling tools (generate_code, get_specs) as alternatives/prerequisites.

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/m-moire'

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