Skip to main content
Glama

generate_story

Generate a Storybook CSF3 story file for a web component using its CEM declaration. Produces TypeScript source with argTypes, default args, render function, and named story exports.

Instructions

Generates a Storybook CSF3 story file for a web component based on its CEM declaration. Returns TypeScript source ready to paste into a .stories.ts file, with argTypes, default args, a render function, and named story exports for each variant value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryIdNoOptional library ID to target a specific loaded library instead of the default.
tagNameYesThe custom element tag name (e.g. "my-button").
Behavior4/5

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

No annotations are provided, so the description bears the full burden. It discloses that the tool returns TypeScript source ready to paste, and lists the structural elements included (argTypes, default args, render function, named exports). This gives a good behavioral expectation without mentioning side effects (likely none) or auth. The level of detail is appropriate for a generation tool.

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 consists of two well-structured sentences. The first sentence states the primary purpose, and the second elaborates on the output content. Every word earns its place; there is no redundancy or fluff. It is front-loaded with the core action.

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 moderate complexity (generates text output from two parameters), the description is largely complete. It explains the output format and includes details about the content. However, it does not mention whether a library must be loaded first (implied by the optional libraryId), which could be considered a slight gap. The absence of an output schema is compensated by the detailed description.

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 the schema already documents both parameters. The description rephrases their purpose: 'libraryId' is optional and targets a specific library, 'tagName' is the custom element tag. This adds minimal extra meaning beyond the schema, so baseline 3 is appropriate.

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 uses a specific verb 'Generates' and clearly identifies the resource as 'Storybook CSF3 story file for a web component based on its CEM declaration'. The output is detailed (TypeScript source with argTypes, default args, render function, named story exports). This distinguishes it from sibling tools like generate_import and generate_types, which have different outputs.

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

Usage Guidelines4/5

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

The description implicitly states usage: when you need to generate a Storybook story from a component's CEM data. It does not explicitly exclude conditions or mention alternatives, but the context is clear enough for an AI agent to infer appropriate use. No sibling tool generates stories, so no confusion.

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/bookedsolidtech/helixir'

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