genart.dev
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

ParameterTypeRequiredDescription
sketchIdstringNoTarget sketch ID. Defaults to the currently active sketch.
layerIdstringYesThe ID of the layer to transform.
xnumberNoHorizontal position in pixels.
ynumberNoVertical position in pixels.
widthnumberNoWidth in pixels.
heightnumberNoHeight in pixels.
rotationnumberNoRotation in degrees.
scaleXnumberNoHorizontal scale factor. 1 is unscaled.
scaleYnumberNoVertical scale factor. 1 is unscaled.
anchorXnumberNoHorizontal anchor point, 01. 0.5 is center.
anchorYnumberNoVertical anchor point, 01. 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

ErrorCause
SKETCH_NOT_FOUNDThe specified sketchId does not exist or no sketch is active.
LAYER_NOT_FOUNDNo layer with the given layerId exists in the sketch.
LAYER_LOCKEDThe layer is locked and cannot be transformed.
INVALID_TRANSFORMA value is non-numeric, or width/height is negative.
NO_CHANGESNo 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
  }
}