Skip to main content
Glama

Generate Component

generate_component
Read-onlyIdempotent

Generate React components from preset templates with design tokens resolved. Specify template name, props, and optional variant to create UI elements that maintain design system consistency.

Instructions

Generate a React component from a preset template, with tokens resolved. Templates come from the active preset's component library.

Args:

  • template_name (string): Component template to generate (e.g. 'GlassCard', 'Sidebar', 'OptionGroup')

  • props (object): Props to inject into the template (default: {})

  • variant (string, optional): Template variant (e.g. 'compact', 'wide', 'collapsible')

Returns:

  • code: Generated React component with tokens resolved

  • templateUsed: Name of the resolved template

  • availableProps: Schema of props the template accepts

Run list_presets with include_metadata to see available templates. Requires active preset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_nameYesComponent template to generate (e.g. 'GlassCard', 'Sidebar')
propsNoProps to inject into the template
variantNoTemplate variant (e.g. 'compact', 'wide')
Behavior3/5

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

Annotations already cover key behavioral traits (readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false). The description adds useful context about token resolution and template sources, but doesn't disclose additional behavioral details like rate limits, error conditions, or authentication needs beyond what annotations provide.

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, args, returns, usage notes) and appropriately sized. Every sentence earns its place, though the 'Args' section could be more concise since it duplicates schema information. It's front-loaded with the core purpose.

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 (3 parameters, nested objects, no output schema) and rich annotations, the description is mostly complete. It explains the purpose, parameters, returns, and prerequisites. However, it doesn't fully describe the return format or error handling, which would be helpful despite the annotations.

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 all parameters thoroughly. The description's 'Args' section repeats this information without adding significant semantic value beyond what's in the schema. The baseline score of 3 is appropriate when the schema does the heavy lifting.

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 specific action ('Generate a React component from a preset template, with tokens resolved'), identifies the resource ('React component'), and distinguishes it from siblings by specifying it uses templates from the active preset's component library. It's not a tautology of the name/title.

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 explicitly states when to use this tool ('Requires active preset') and provides an alternative action ('Run list_presets with include_metadata to see available templates') for discovering templates. It clearly differentiates from siblings like 'list_presets' or 'load_preset' by focusing on generation.

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/ncsound919/OG-Glass'

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