Skip to main content
Glama

generate_component

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')

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