Skip to main content
Glama
MCP Design System Extractor

MCP Design System Extractor

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

NameRequiredDescriptionDefault
asyncNoIf true (default), returns job_id immediately - use job_status to poll for results. If false, waits for result synchronously.
timeoutNoCustom timeout in milliseconds (5000-60000). Only used in sync mode (async=false). Default is 15000ms.
componentIdYesThe story ID in format "component-name--story-name" (e.g., "button--primary") or component ID (e.g., "button") when using variantsOnly.
variantsOnlyNoIf true, returns only the list of available variants/stories for the component (synchronous). Use component ID without story suffix.
includeStylesNoWhether to include extracted CSS styles in the response. Storybook boilerplate CSS is filtered out. Default: false.

Output Schema

NameRequiredDescriptionDefault
htmlNosync mode
job_idNoasync mode
statusNoasync mode
stylesNosync mode with includeStyles=true; Storybook boilerplate is filtered out
classesNosync mode
storyIdNosync mode
variantsNovariantsOnly mode
componentIdNovariantsOnly mode
component_idNoasync mode

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0
  2. Removedv1.2.0
  3. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description has to carry the whole behavioural burden, and it does disclose the non-obvious async contract (returns a job_id, poll with job_status) and the existence of a sync alternative. It says nothing about permissions, failure behaviour, or size limits, but the async detail is the main risk an agent would otherwise miss.

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?

Three short sentences, front-loaded with the core action, then the async default, then the variant mode. The variantsOnly sentence largely duplicates the schema but is defensible as mode-switching guidance; nothing is padded.

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?

For a five-parameter extraction tool with full schema coverage and an output schema, the description covers the decisions an agent must make: sync vs async and variant-list vs HTML extraction. It omits error and timeout handling, which is the main remaining gap.

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 all five parameters are already documented, including timeout range and includeStyles default. The description restates the async and variantsOnly semantics without adding syntax, constraints, or trade-offs beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description leads with a specific verb and resource: "Extract HTML from a component." It also names job_status for polling, which separates it from the job-management siblings. It does not explicitly distinguish itself from get_component_dependencies or get_external_css, which are the closest neighbours in the sibling list.

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?

It gives clear mode-selection guidance: async is the default and requires polling via job_status, async=false forces synchronous behaviour, and variantsOnly=true switches the call into a variant-listing mode. There are no explicit exclusions telling the agent when another tool is the better choice, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.