Skip to main content

update_item_property

Set one property of an item to a value, using the friendly REST property names from get_data_model (e.g. "text", "fontSize", "fillColor", "strokeColor", "angle", or "position"={x,y} / "size"={width,height}). Keys inside position/size are case-insensitive. Setting "size" on a label or sticky also pins its auto-size flags, so the new width is the width its text wraps at; pass height 0 to keep the height growing with the text. To change only how a label grows, set "autoSize" ("none" | "width" | "height" | "both") or "isAutoSizeWidth" / "isAutoSizeHeight" (true/false): the size follows - an auto axis goes to 0, a fixed one keeps the size it has, and an axis that grows today can only be fixed via "size". Label auto-size (autoSize): "height" wraps at size.width and grows down - use it for running text of unknown length; "width" is one line that grows right at a fixed size.height; "both" is one line that grows freely (size is ignored); "none" is a fixed size.width x size.height box that clips text that does not fit - the user only sees a red overflow handle when they select the label. A sticky never auto-sizes. Setting backgroundColor or fillColor to null (or "#00000000") removes the fill. "cornerRadius" of a round-corner shape is in world units and is converted at the shape's current size - set it after "size", not before. "text" of a label or sticky: Label text is plain text, where each line break starts a new line. For formatting it takes only these tags: <p> for each line, <ul>/<ol> with <li> (not nested), <br>, <b>/<strong>, <i>/<em>, <u>, <a href="https://..."> and <span style="..."> with font-weight, font-style:italic, text-decoration:underline, color and background-color (#RRGGBB). The whole text has one fontSize and fontFamily - span font-size, headings and other tags are rejected. The stored form get_project returns as html (<html><body>...) is accepted too. Colors are hex strings only - "#RRGGBB" (e.g. "#3B82F6"), or "#AARRGGBB" for alpha (alpha first). rgb()/rgba(), hsl() and named colors are rejected. The item type is resolved automatically; for items other than labels and stickies, passing itemType skips the lookup. The result may carry warnings: [{itemId, code, message}] for text cut off by its box (TEXT_HEIGHT_TOO_SMALL), text running into other text (TEXT_OVERLAP), text that cannot be read on what is behind it (LOW_CONTRAST), text running past the shape it starts on (OUTSIDE_PARENT_SHAPE) and text a new shape hides (TEXT_COVERED). The write happened; fix what they name before reporting the work as done.

The case-insensitive keys of position and size hold for the string-encoded form of value too.

Tool name: update_item_property

Parameters​

ParameterTypeRequiredDefaultDescription
projectIdstringYes—Target project (map) id.
itemIdstringYes—Id of the item to update.
propertyNamestringYes—Property name, e.g. "text", "fillColor", "angle".
valueanyYes—New value — string, number, boolean, or object as appropriate.
itemTypestringNoAuto-resolvedOne of label, sticky-note, shape, connector, image, web, svg, document.

Common Properties​

PropertyValue shapeApplies to
textstring: plain text, or the tags in text formattinglabels, stickies
fontSizenumber ≥ 1labels, stickies
fillColorhex color string — "#RRGGBB" or "#AARRGGBB"; null or "#00000000" removes the fillshapes
backgroundColorhex color string; null or "#00000000" removes the backgroundlabels, stickies
textColorhex color stringlabels, stickies
strokeColorhex color string — "#RRGGBB" or "#AARRGGBB"shapes, connectors
strokeThicknessnumber ≥ 0shapes, connectors
cornerRadiusnumber ≥ 0 in world units, converted at the shape's current size, so set it after sizeround-corner shapes
position{ "x": number, "y": number }all items
size{ "width": number, "height": number }all items
autoSize"height", "width", "both" or "none" — see create_item sizinglabels
isAutoSizeWidthboolean — the width half of autoSize: true ignores size.width and grows on one linelabels
isAutoSizeHeightboolean — the height half of autoSize: true ignores size.height and grows with its textlabels
anglenumber (degrees, 0–360)all items

Changing how a label grows​

autoSize, isAutoSizeWidth and isAutoSizeHeight update both flags and the size together, so the label stays valid:

  • An axis that becomes auto-sized is set to size 0.
  • An axis that stays or becomes fixed keeps the size it already has.
  • An axis that grows with its text today has no size worth keeping, so fixing it is rejected with a hint to set size instead — e.g. { "width": 300, "height": 0 } wraps at 300 and grows down, { "width": 300, "height": 80 } is a fixed box.

A fixed box ("none") clips text that does not fit; the user only sees a red overflow handle when they select the label.

The full per-type field reference is available via get_data_model.

Resizing a label or sticky​

A label only honours its size on an axis whose auto-size flag is false, so setting size alone used to have no visible effect — the text kept flowing on one line. Setting size now writes both flags for you, deriving each from the matching dimension:

size valueResult
{ "width": 400, "height": 0 }Wraps at 400, grows downwards with the text
{ "width": 400, "height": 300 }Fixed 400x300 box; text beyond it is clipped
{ "width": 0, "height": 0 }Back to auto-sizing on both axes

Pass isAutoSizeWidth or isAutoSizeHeight in a separate call to override a derived flag; an explicit value always wins over the derived one. Avoid isAutoSizeWidth: false with size.width: 0 — that combination renders nothing.

Returns​

{ "updated": true, "itemId": "11aa22bb-...", "propertyName": "text" }

The result may also carry warnings about the layout the write left behind.

Example​

"Rotate the hexagon by 45 degrees."

{
"projectId": "a1b2c3d4-...",
"itemId": "77gg88hh-...",
"propertyName": "angle",
"value": 45
}

For color and font changes, style_item is usually more convenient — it maps fields to the right property per item type automatically.