get_component_html
Extract a Storybook component's HTML and optional CSS styles for design system analysis. Use async job polling or sync results, or list available variants.
Instructions
Extract HTML from a component. Default is async (returns job_id, poll with job_status). Set async=false for sync mode. Use variantsOnly=true to get variant list.
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": {
"componentId": "<componentId>"
},
"name": "get_component_html"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| async | No | If true (default), returns job_id immediately - use job_status to poll for results. If false, waits for result synchronously. | |
| timeout | No | Custom timeout in milliseconds (5000-60000). Only used in sync mode (async=false). Default is 15000ms. | |
| componentId | Yes | The story ID in format "component-name--story-name" (e.g., "button--primary") or component ID (e.g., "button") when using variantsOnly. | |
| variantsOnly | No | If true, returns only the list of available variants/stories for the component (synchronous). Use component ID without story suffix. | |
| includeStyles | No | Whether to include extracted CSS styles in the response. Storybook boilerplate CSS is filtered out. Default: false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | sync mode | |
| job_id | No | async mode | |
| status | No | async mode | |
| styles | No | sync mode with includeStyles=true; Storybook boilerplate is filtered out | |
| classes | No | sync mode | |
| storyId | No | sync mode | |
| variants | No | variantsOnly mode | |
| componentId | No | variantsOnly mode | |
| component_id | No | async mode |