Get a component contract
get_componentRetrieves a component's full contract—import, props/types/defaults, cva variants, parts, tokens, docs, and examples—so agents can build matching UI. Call before using a component.
Instructions
Get the full contract of one component: import, props with types and defaults, cva variants and the classes each applies, parts (sub-components), design tokens it uses, usage guidelines and examples from its docs. Call it before using a component. Accepts "Button", "CardHeader" or "Card.Header". At a monorepo root, pass path (the file you are editing) to get the component its project uses.
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": {
"name": "<name>"
},
"name": "get_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Component name, e.g. "Button" or "CardHeader". | |
| path | No | In a monorepo served from its root: the file you are editing, or a project folder, relative to the root, to answer from that project. Without it, every project is listed together. Ignored in a single project. When the server was started outside your project, pass the file as an absolute path: the project is found from it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docs | No | ||
| name | Yes | How the component is written in JSX: Button, CardHeader, Tabs.List. | |
| props | Yes | ||
| import | Yes | The import statement to use. | |
| parent | No | ||
| source | Yes | ||
| tokens | Yes | Names of the design tokens its classes use. | |
| aliases | Yes | ||
| cssVars | Yes | ||
| element | No | The native element it renders or wraps. | |
| library | No | The published package it is read from, by its type declarations: "@mui/material". | |
| package | No | At a workspace root: the package its source belongs to, e.g. "@acme/ui". | |
| examples | Yes | ||
| inherits | Yes | ||
| projects | No | At a workspace root: the folders of the projects that use it. | |
| variants | Yes | ||
| openProps | Yes | Part of the props type did not resolve; extra props may be accepted. | |
| classNames | Yes | ||
| deprecated | No | ||
| exportName | Yes | ||
| importPath | Yes | ||
| description | No | ||
| labelsChild | No | A prop whose text is its child element's accessible name (MUI Tooltip's title), unless `unless` is set. | |
| polymorphic | No | A prop that renders another element or component in its place, with its props: "component". | |
| defaultImport | No | Another module that exports it as its default: "@mui/material/Button". | |
| subcomponents | Yes | ||
| compoundVariants | Yes |