MCP ToolsDesign Layers
design_set_transform
Set position, size, rotation, and scale on a design layer.
Set the transform properties of a design layer. All fields are optional — only the provided values are updated. Unprovided fields retain their current values.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
sketchId | string | No | Target sketch ID. Defaults to the currently active sketch. |
layerId | string | Yes | The ID of the layer to transform. |
x | number | No | Horizontal position in pixels. |
y | number | No | Vertical position in pixels. |
width | number | No | Width in pixels. |
height | number | No | Height in pixels. |
rotation | number | No | Rotation in degrees. |
scaleX | number | No | Horizontal scale factor. 1 is unscaled. |
scaleY | number | No | Vertical scale factor. 1 is unscaled. |
anchorX | number | No | Horizontal anchor point, 0–1. 0.5 is center. |
anchorY | number | No | Vertical anchor point, 0–1. 0.5 is center. |
Output Shape
{
"layerId": "layer_f7e2d1",
"name": "Background Circle",
"transform": {
"x": 200,
"y": 150,
"width": 500,
"height": 500,
"rotation": 45,
"scaleX": 1,
"scaleY": 1,
"anchorX": 0.5,
"anchorY": 0.5
}
}Side Effects
- The layer is repositioned, resized, or rotated on the canvas.
- The design composite re-renders with the updated transform.
- Bounding box handles in the UI update to reflect the new geometry.
Error Cases
| Error | Cause |
|---|---|
SKETCH_NOT_FOUND | The specified sketchId does not exist or no sketch is active. |
LAYER_NOT_FOUND | No layer with the given layerId exists in the sketch. |
LAYER_LOCKED | The layer is locked and cannot be transformed. |
INVALID_TRANSFORM | A value is non-numeric, or width/height is negative. |
NO_CHANGES | No transform fields were provided. |
Golden Path Example
Request
{
"layerId": "layer_f7e2d1",
"x": 200,
"y": 150,
"rotation": 45
}Response
{
"layerId": "layer_f7e2d1",
"name": "Background Circle",
"transform": {
"x": 200,
"y": 150,
"width": 500,
"height": 500,
"rotation": 45,
"scaleX": 1,
"scaleY": 1,
"anchorX": 0.5,
"anchorY": 0.5
}
}