Skip to main content

create_item

Creates a text item: kind label (text) or sticky (a sticky note with a colored background). Returns the new item id.

Pass size to set the width the text wraps at. Without it a label stays on a single growing line, and a sticky uses the default 212x106 and clips anything longer.

Tool name: create_item

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesTarget project (map) id.
kindstringYes"label" or "sticky".
textstringYesText content (plain text or HTML).
positionobjectNo{ x: 0, y: 0 }World-coordinate position of the item's top-left, { x, y }.
sizeobjectNoSee belowBounding box { width, height } in world units, min 5 per dimension. width sets the wrap width.
fontSizenumberNoTheme defaultFont size in points. Must be ≥ 1.
fontFamilystringNoTheme defaultFont family name.
textColorstringNoTheme defaultText color, hex e.g. "#FFFFFF".
backgroundColorstringNoTheme defaultBackground color, hex.
horizontalTextAlignmentstringNo"Left""Left", "Center", or "Right".
verticalTextAlignmentstringNo"Top""Top", "Center", or "Bottom".
parentIdstringNoProject canvasContainer id to place the item under.

Returns

{ "created": true, "itemId": "11aa22bb-...", "kind": "sticky" }

Example

"Add a yellow sticky note that says 'Ship v2 by Friday'."

{
"projectId": "a1b2c3d4-...",
"kind": "sticky",
"text": "Ship v2 by Friday",
"position": { "x": 300, "y": 150 },
"backgroundColor": "#FDE047",
"textColor": "#1F2937"
}

Sizing

size.width is the width the text wraps at. size.height behaves differently per kind:

Kindsize omittedsize.height omittedsize.height given
labelOne growing line, no wrappingWraps at width, grows downwards with the textFixed box; text beyond it is clipped
sticky212x106, clips longer textWraps at width, height falls back to 106Fixed box; text beyond it is clipped

Under the hood this sets the item's isAutoSizeWidth / isAutoSizeHeight flags — an axis only honours its size when the matching flag is false. get_project reports both flags, so you can check what an item ended up with. See label items for the full rules.

Example: wrap a long label

"Add the press release text as a label 400 units wide."

{
"projectId": "a1b2c3d4-...",
"kind": "label",
"text": "Die Bundesbildungsministerin ...",
"position": { "x": 0, "y": 0 },
"size": { "width": 400 }
}

The label wraps at 400 units and grows downwards for as much text as you give it.

To restyle the item later, use style_item; to change its text or move it, use update_item_property.