Skip to main content

create_shape

Places a geometric shape (rectangle, ellipse, arrow, star, …) on a project canvas. Position is the world-coordinate top-left; size is the bounding box. Returns the new item id.

Tool name: create_shape

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesTarget project (map) id.
shapestringYesShape type from the supported set below.
positionobjectYesWorld-coordinate top-left of the shape, { x, y }.
sizeobjectNo{ width: 120, height: 120 }Bounding box in world coordinates, { width, height }.
fillColorstringNo"#3B82F6"Fill color, hex.
strokeColorstringNoTheme defaultOutline color, hex.
strokeThicknessnumberNo2Outline width in px. Must be ≥ 0.
parentIdstringNoProject canvasContainer id to place the shape under.

Supported Shapes

Rectangles

Rectangle, RoundedRectangle, OneRoundCornerRectangle, TwoSameSideRoundCornerRectangle, TwoDiagonalRoundCornerRectangle, TwoSameSideSnipCornerRectangle, TwoDiagonalSnipCornerRectangle, OneSnipCornerRectangle, OneSnipOneRoundCornerRectangle

Basic shapes

Ellipse, Donut, Triangle, RightTriangle, Diamond, Parallelogram, Trapezoid, Pentagon, Hexagon, Heptagon, Octagon, Decagon, Dodecagon, Frame, HalfFrame, Corner, Plus, Plaque, Heart, LightningBolt

Stars

Star4, Star5, Star6

Arrows

RightArrow, LeftArrow, UpArrow, DownArrow, LeftRightArrow, UpDownArrow, NotchedRightArrow, StripedRightArrow, QuadArrow, LeftRightUpArrow, DirectionArrow, DirectionArrowRight, DirectionArrowLeft

The same list is available at runtime via get_data_model.

Returns

{ "created": true, "itemId": "77gg88hh-...", "shape": "Hexagon" }

Example

"Draw a green hexagon next to the sticky note."

{
"projectId": "a1b2c3d4-...",
"shape": "Hexagon",
"position": { "x": 600, "y": 150 },
"size": { "width": 160, "height": 140 },
"fillColor": "#22C55E"
}

To recolor the shape later, use style_item.