update_items
Update one or many items in one call, as one change: if any entry is invalid nothing changes and the error names its index. At most 200 entries, one per item. An entry names its item by itemId or by the externalId you gave it; both together give the item that externalId. An entry sets several properties at once by the friendly names from get_data_model, e.g. "text", "fontSize", "fillColor", "strokeColor", "strokeThickness", "textColor", "angle", or "position"={x,y} / "size"={width,height}. Keys inside position/size are case-insensitive. The item type comes from the item, and a key it does not have is rejected by name. 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 by sending "size" with it. 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; fillColor on a label or sticky is its background. "cornerRadius" of a round-corner shape is in world units, at the size the entry leaves the shape with. A shape's "text" and its text keys ("fontSize", "fontFamily", "textColor", the alignments) change only what they name, null "text" removes it; "labels" of a connector replaces every label. "text" of a label, sticky or shape: 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. Returns [{itemId}] in entry order, each with its own warnings. 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.
Tool name: update_items
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | — | Target project (map) id. |
items | object[] | Yes | — | The entries, at most 200, one per item. |
items[].itemId | string | No | — | Id of the item to update. Leave it out to name the item by externalId. |
items[].externalId | string | No | — | Your own id of the item: names it when itemId is left out; beside an itemId, gives the item this external id. |
items[].properties | object | No | — | The properties to set, by the friendly names of get_data_model. May be left out when the entry only gives an item its externalId. |
Returns
{
"updated": 2,
"items": [
{ "itemId": "11aa22bb-..." },
{ "itemId": "33cc44dd-...", "warnings": [{ "itemId": "33cc44dd-...", "code": "TEXT_HEIGHT_TOO_SMALL", "message": "..." }] }
]
}
If any entry is invalid, nothing changes and the error names it, e.g. Nothing was updated: ... update[1]: Property 'colour' is not a valid property for this type.
Example
"Rename the card, move it under the header and make it blue. Mark the second card as done."
{
"projectId": "a1b2c3d4-...",
"items": [
{
"itemId": "11aa22bb-...",
"properties": {
"text": "Kick-off",
"position": { "x": 100, "y": 240 },
"size": { "width": 300, "height": 0 },
"fillColor": "#3B82F6"
}
},
{ "itemId": "33cc44dd-...", "properties": { "textColor": "#16A34A" } }
]
}