Skip to main content
Glama

create_spec

Create or update component, page, or dataviz specs in the local registry with Zod validation. Define new specs before code generation or update existing ones.

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, the description fully covers behavioral traits: silent overwrite, validation against Zod schemas, return value format, error behavior for validation/JSON/type failures, and detailed spec type schemas. No contradictions.

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?

Well-structured and front-loaded with essential info, but the spec type schemas section is quite lengthy. Though detailed, it could be slightly trimmed or moved to reduce verbosity without losing value.

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 annotations or output schema, the description covers return type, error details, validation requirements, and even a usage pattern. It fully equips the agent to invoke the tool correctly and understand consequences (e.g., overwriting).

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?

Schema coverage is 100% but the description adds immense value beyond the schema's brief description. It details the structure for each spec type, enhancing the agent's understanding of valid input far beyond the schema's generic 'JSON string' 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?

Clearly states the action ('Create or overwrite a spec') and the resource ('in the local registry'). Distinguishes from sibling tools by specifying it's for creating/updating specs with validation, unlike retrieval or other operations.

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?

Provides explicit when-to-use guidance ('to define a new component before calling generate_code, or to update an existing spec's props or variants') and a key precaution ('Always call get_specs first to avoid accidentally overwriting an existing spec'). Also notes no 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/memi'

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