Skip to main content

connect_items

Draw a connector (line/arrow) between two existing items. Defaults to a straight line with an arrow at the end. labels put text on the line: each sits at position along the drawn line (0 the start, 0.5 the middle, 1 the end) and offset across it (-1 just clear on the left of travel, 0 on the line, which is cut behind it, 1 just clear on the right, anything between; side Above / On / Below is shorthand for -1 / 0 / 1), and moves with the line. Connector or arrow shape? connect_items draws a thin line/arrow attached to two items that follows them when they move - use it for relationships and flow edges. A block arrow shape (create_shape, e.g. RightArrow) is a standalone filled area, not attached to anything - use it between process steps, as a direction cue, callout or header, and style it like any shape (fillColor, strokeColor, its own text). Colors are hex strings only - "#RRGGBB" (e.g. "#3B82F6"), or "#AARRGGBB" for alpha (alpha first). rgb()/rgba(), hsl() and named colors are rejected. Returns the new connector id.

Tool name: connect_items

Parameters​

ParameterTypeRequiredDefaultDescription
projectIdstringYes—Target project (map) id.
sourceItemIdstringYes—Id of the item the connector starts at.
targetItemIdstringYes—Id of the item the connector ends at.
typeenumNo"Straight"Line type: "Straight", "Angled" (from side to side with right-angle bends), or "Curved".
strokeColorstringNoTheme defaultLine color, hex.
strokeThicknessnumberNo3Line thickness in px. Must be ≥ 0.
startDecoratorenumNo"None"Endpoint marker at the start: "None", "Arrow", "ArrowLine", or "Circle".
endDecoratorenumNo"ArrowLine"Endpoint marker at the end: "None", "Arrow", "ArrowLine", or "Circle".
parentIdstringNoProject canvasContainer id to place the connector under.
labelsarrayNoNoneText labels along the line, see Labels.

Labels​

FieldTypeRequiredDefaultDescription
textstringYes—The label text, in the same format as create_item text.
positionnumberNo0.5Where along the drawn line: 0 the start, 0.5 the middle, 1 the end. Values outside 0 to 1 are an error.
offsetnumberNo0Where across the line, along its direction: -1 just clear of it on the left, 0 on the line (cut behind the label), 1 just clear on the right, anything between. Values outside -1 to 1 are an error.
sideenumNo—Shorthand for offset: "Above" = -1, "On" = 0, "Below" = 1. Like offset it follows the line's direction, so "Above" and "Below" are above and below only on a line drawn left to right; on one drawn right to left they swap, and on a vertical line they are its sides. Give offset or side, not both.
fontSizenumberNo15Font size in points.
textColorstringNoContrasts with the canvasText color, hex.
backgroundColorstringNoNoneBackground behind the label, hex.

Labels stay horizontal whatever the angle of the line. get_project with fields ["labels"] returns each one's id, text, position and offset; update_items with labels replaces every label of the connector.

Item ids come from get_project or from the create tools' results.

Returns​

{ "created": true, "connectorId": "99ii00jj-..." }

Example​

"Connect the 'Idea' sticky to the 'In Progress' shape with a straight arrow."

{
"projectId": "a1b2c3d4-...",
"sourceItemId": "11aa22bb-...",
"targetItemId": "77gg88hh-...",
"type": "Straight"
}

To restyle the connector afterwards, use update_items (strokeColor, strokeThickness).

A connector is attached to both items and follows them when they move — right for relationships and flow edges. When it is created, each end is placed in the middle of the side that faces the other item (a turned item's own side); the ends keep those places when the items move later. For a big filled arrow that is a design element of its own (between process steps, a direction cue, a header), place a block arrow shape with create_shape instead.