Generate Component
generate_componentGenerate 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template_name": "<template_name>"
},
"name": "generate_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_name | Yes | Component template to generate (e.g. 'GlassCard', 'Sidebar') | |
| props | No | Props to inject into the template | |
| variant | No | Template variant (e.g. 'compact', 'wide') |