MCP ToolsComponents
add_component
Add component dependency to sketch.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
sketchId | string | Yes | ID of the sketch to add the component to. |
component | string | Yes | Name of the component to add. |
version | string | No | Semver version range for the component. Default: "^1.0.0". |
Output Shape
{
"sketchId": "my-sketch-01",
"component": "perlin-noise",
"version": "^1.0.0",
"added": true
}Side Effects
- Adds the component as a dependency in the sketch definition.
- The component code becomes available to the sketch algorithm at render time.
Error Cases
| Error | Cause |
|---|---|
Sketch not found | The provided sketchId does not match any saved sketch. |
Component not found | The provided component name does not match any available component. |
Component already added | The sketch already includes this component as a dependency. |
Incompatible renderer | The component does not support the sketch's renderer type. |
Golden Path Example
Request
{
"sketchId": "my-sketch-01",
"component": "perlin-noise",
"version": "^1.0.0"
}Response
{
"sketchId": "my-sketch-01",
"component": "perlin-noise",
"version": "^1.0.0",
"added": true
}