Skip to main content
Glama

Add elements to the board or create a new one

add_elements

Creates elements on a canvas. Creates a new canvas if room_id is omitted, or adds to the existing canvas if room_id is provided. Use cases: wireframes, UI mockups, freeform illustrations, standalone shapes, and manual layouts that Mermaid does not cover well. For diagrams Mermaid can express, use add_elements_from_mermaid instead. Element types: rectangle, ellipse, diamond, arrow, line, freedraw, text, image. Rich text: the text field supports limited HTML for text elements and rectangle/ellipse/diamond shape labels. Supports the rich-text plugin HTML subset: /, /, , , /, //, , , and . Use textAlign for left/center/right alignment; avoid unsupported HTML/CSS. TEXT IN SHAPES: use containerId on text element pointing to shape id. ARROWS: Position at EDGE of source shape. Auto-bound within 30px. Colors: strokeColor, backgroundColor (hex).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "elements": "<elements>"
    },
    "name": "add_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
room_idNoRoom ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /?gdrive=[room_id]), pass it here. Omit to create a new canvas.
elementsYesArray of element definitions to create

Output Schema

NameRequiredDescriptionDefault
urlYesCanvas room URL
isNewYesWhether a new canvas was created
room_idNoCanvas room ID
appStateYesCanvas app state (viewBackgroundColor, etc.)
elementsYesAll elements currently on the canvas
collabUrlYesCollaboration server URL for Socket.IO

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / room_id / description
      Previous value: -"Room ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /gdrive?id=[room_id]), pass it here. Omit to create a new canvas."New value: +"Room ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /?gdrive=[room_id]), pass it here. Omit to create a new canvas."
  2. Changed1 schema field changed
    • changedInput schema / properties / room_id / description
      Previous value: -"Room ID. If not provided, creates a new canvas. Extract from URLs as ?room=[room_id] or /gdrive?id=[room_id]."New value: +"Room ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /gdrive?id=[room_id]), pass it here. Omit to create a new canvas."
  3. Changed2 schema fields changed
    • changedInput schema / properties / elements / items / description
      Previous value: -"Per-type required fields: rectangle/ellipse/diamond → x, y (width/height default to 100). text → x, y, text (width/height auto-sized; omit or set to 0). arrow/line → x, y, points (e.g. [[0,0],[100,0]]); optionally startBinding/endBinding instead of points. image → x, y, width, height, fileId. freedraw → x, y, points. type is inferred from fields if omitted (text field → text, points → line, fileId → image, else rectangle)."New value: +"Per-type required fields: rectangle/ellipse/diamond → x, y (width/height default to 100). text → x, y, text (width/height auto-sized; omit or set to 0). rectangle/ellipse/diamond may also include text, which creates a bound label. arrow/line → x, y, points (e.g. [[0,0],[100,0]]); optionally startBinding/endBinding instead of points. image → x, y, width, height, fileId. freedraw → x, y, points. type is inferred from fields if omitted (text field → text, points → line, fileId → image, else rectangle)."
    • changedInput schema / properties / elements / items / properties / text / description
      Previous value: -"Text content. Required for type=text. Also used as arrow label when set on an arrow."New value: +"Text content. Required for type=text. For text elements and rectangle/ellipse/diamond shape labels, Supports the rich-text plugin HTML subset: <b>/<strong>, <i>/<em>, <u>, <br>, <div>/<p>, <ul>/<ol>/<li>, <a href>, <font color>, and <span style=\"color, background/background-color, font-size, font-family\">. Use textAlign for left/center/right alignment; avoid unsupported HTML/CSS. Also used as arrow label when set on an arrow."
  4. Changed3 schema fields changed
    • addedInput schema / properties / room_id
      Added value: +{
      +  "description": "Room ID. If not provided, creates a new canvas. Extract from URLs as ?room=[room_id] or /gdrive?id=[room_id].",
      +  "type": "string"
      +}
    • removedInput schema / properties / room_url
      Removed value: -{
      -  "description": "Room URL or ID. If not provided, creates a new canvas",
      -  "type": "string"
      -}
    • addedOutput schema / properties / room_id
      Added value: +{
      +  "description": "Canvas room ID",
      +  "type": "string"
      +}
  5. Changed18 schema fields changed
    • addedInput schema / properties / elements / items / description
      Added value: +"Per-type required fields: rectangle/ellipse/diamond → x, y (width/height default to 100). text → x, y, text (width/height auto-sized; omit or set to 0). arrow/line → x, y, points (e.g. [[0,0],[100,0]]); optionally startBinding/endBinding instead of points. image → x, y, width, height, fileId. freedraw → x, y, points. type is inferred from fields if omitted (text field → text, points → line, fileId → image, else rectangle)."
    • changedInput schema / properties / elements / items / properties / containerId / description
      Previous value: -"Container element ID (for text bound to shapes). Set x,y to 0,0 for auto-centering"New value: +"For type=text: ID of the shape this text is bound to. Set x,y to 0,0 for auto-centering inside the shape."
    • changedInput schema / properties / elements / items / properties / endBinding / description
      Previous value: -"For arrows: bind end point to a shape."New value: +"For type=arrow: binds the arrow end to a shape. Use instead of or alongside points."
    • addedInput schema / properties / elements / items / properties / endBinding / required
      Added value: +[
      +  "elementId",
      +  "focus",
      +  "gap"
      +]
    • changedInput schema / properties / elements / items / properties / fontFamily / description
      Previous value: -"Font family: 5=Excalifont, 6=Nunito, 7=Lilita One, 8=Comic Shanns (default: 5)"New value: +"Font family: 5=Excalifont, 6=Nunito, 7=Lilita One, 8=Comic Shanns (default: 5). Applies to text elements."
    • changedInput schema / properties / elements / items / properties / fontSize / description
      Previous value: -"Font size (default: 20)"New value: +"Font size (default: 20). Applies to text elements."
    • changedInput schema / properties / elements / items / properties / height / description
      Previous value: -"Height (default: 100)"New value: +"Height (default: 100; omit for text — auto-sized)"
    • changedInput schema / properties / elements / items / properties / label / description
      Previous value: -"For arrows: text label displayed on the arrow"New value: +"For type=arrow: text label displayed on the arrow"
    • changedInput schema / properties / elements / items / properties / points / description
      Previous value: -"Points array for arrows/lines. Relative to element x,y. Example: [[0,0],[0,100]] for vertical arrow"New value: +"Required for arrow/line/freedraw. Coordinates relative to element x,y. Example: [[0,0],[100,0]] for horizontal arrow."
    • changedInput schema / properties / elements / items / properties / startBinding / description
      Previous value: -"For arrows: bind start point to a shape."New value: +"For type=arrow: binds the arrow start to a shape. Use instead of or alongside points."
    • addedInput schema / properties / elements / items / properties / startBinding / required
      Added value: +[
      +  "elementId",
      +  "focus",
      +  "gap"
      +]
    • changedInput schema / properties / elements / items / properties / text / description
      Previous value: -"Text content (for text elements)"New value: +"Text content. Required for type=text. Also used as arrow label when set on an arrow."
    • changedInput schema / properties / elements / items / properties / type / description
      Previous value: -"Element type (e.g. rectangle, ellipse, diamond, arrow, line, freedraw, text, image)"New value: +"Element type. Inferred from fields if omitted: text field → text, points → line, fileId → image, else rectangle."
    • addedInput schema / properties / elements / items / properties / type / enum
      Added value: +[
      +  "rectangle",
      +  "ellipse",
      +  "diamond",
      +  "arrow",
      +  "line",
      +  "freedraw",
      +  "text",
      +  "image"
      +]
    • changedInput schema / properties / elements / items / properties / width / description
      Previous value: -"Width (default: 100)"New value: +"Width (default: 100; omit for text — auto-sized)"
    • changedInput schema / properties / elements / items / properties / x / description
      Previous value: -"X coordinate"New value: +"X coordinate (defaults to 0 if omitted)"
    • changedInput schema / properties / elements / items / properties / y / description
      Previous value: -"Y coordinate"New value: +"Y coordinate (defaults to 0 if omitted)"
    • changedInput schema / properties / elements / items / required
      Previous value: -[
      -  "type",
      -  "x",
      -  "y"
      -]New value: +[
      +  "x",
      +  "y"
      +]
  6. Changed7 schema fields changed
    • addedOutput schema / properties / appState / additionalProperties
      Added value: +true
    • changedOutput schema / properties / appState / description
      Previous value: -"Current app state (viewBackgroundColor, etc.)"New value: +"Canvas app state (viewBackgroundColor, etc.)"
    • addedOutput schema / properties / appState / properties
      Added value: +{
      +  "viewBackgroundColor": {
      +    "type": "string"
      +  }
      +}
    • changedOutput schema / properties / elements / description
      Previous value: -"Current scene elements for inline SVG rendering"New value: +"All elements currently on the canvas"
    • addedOutput schema / properties / elements / items
      Added value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
    • removedOutput schema / properties / pendingMermaid
      Removed value: -{
      -  "description": "Mermaid definition to be rendered client-side",
      -  "type": "object"
      -}
    • addedOutput schema / required
      Added value: +[
      +  "url",
      +  "isNew",
      +  "collabUrl",
      +  "elements",
      +  "appState"
      +]
  7. Changed14 schema fields changed
    • changedInput schema / properties / elements / items / properties / endBinding / description
      Previous value: -"For arrows: bind end point to a shape. REQUIRED for connected diagrams!"New value: +"For arrows: bind end point to a shape."
    • removedInput schema / properties / elements / items / properties / endBinding / properties / elementId / description
      Removed value: -"ID of shape to connect to (REQUIRED)"
    • removedInput schema / properties / elements / items / properties / endBinding / properties / focus / description
      Removed value: -"Position on edge: -1 to 1, 0=center (REQUIRED, use 0)"
    • removedInput schema / properties / elements / items / properties / endBinding / properties / gap / description
      Removed value: -"Gap from shape edge in pixels (REQUIRED, use 8)"
    • removedInput schema / properties / elements / items / properties / endBinding / required
      Removed value: -[
      -  "elementId",
      -  "focus",
      -  "gap"
      -]
    • removedInput schema / properties / elements / items / properties / locked
      Removed value: -{
      -  "description": "Lock element (default: false)",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / elements / items / properties / startBinding / description
      Previous value: -"For arrows: bind start point to a shape. REQUIRED for connected diagrams!"New value: +"For arrows: bind start point to a shape."
    • removedInput schema / properties / elements / items / properties / startBinding / properties / elementId / description
      Removed value: -"ID of shape to connect to (REQUIRED)"
    • removedInput schema / properties / elements / items / properties / startBinding / properties / focus / description
      Removed value: -"Position on edge: -1 to 1, 0=center (REQUIRED, use 0)"
    • removedInput schema / properties / elements / items / properties / startBinding / properties / gap / description
      Removed value: -"Gap from shape edge in pixels (REQUIRED, use 8)"
    • removedInput schema / properties / elements / items / properties / startBinding / required
      Removed value: -[
      -  "elementId",
      -  "focus",
      -  "gap"
      -]
    • changedInput schema / properties / elements / items / properties / type / description
      Previous value: -"Element type"New value: +"Element type (e.g. rectangle, ellipse, diamond, arrow, line, freedraw, text, image)"
    • removedInput schema / properties / elements / items / properties / type / enum
      Removed value: -[
      -  "rectangle",
      -  "ellipse",
      -  "diamond",
      -  "arrow",
      -  "line",
      -  "freedraw",
      -  "text",
      -  "image"
      -]
    • removedInput schema / properties / timeout
      Removed value: -{
      -  "default": 3600,
      -  "description": "Room lifetime in seconds (default: 3600, max: 86400). Only used when creating new canvas",
      -  "type": "number"
      -}
  8. Changed6 schema fields changed
    • changedInput schema / properties / elements / items / properties / endBinding / properties / focus / description
      Previous value: -"Position on edge: -1 to 1, 0=center (default: 0)"New value: +"Position on edge: -1 to 1, 0=center (REQUIRED, use 0)"
    • changedInput schema / properties / elements / items / properties / endBinding / properties / gap / description
      Previous value: -"Gap from shape edge in pixels (default: 8)"New value: +"Gap from shape edge in pixels (REQUIRED, use 8)"
    • addedInput schema / properties / elements / items / properties / endBinding / required
      Added value: +[
      +  "elementId",
      +  "focus",
      +  "gap"
      +]
    • changedInput schema / properties / elements / items / properties / startBinding / properties / focus / description
      Previous value: -"Position on edge: -1 to 1, 0=center (default: 0)"New value: +"Position on edge: -1 to 1, 0=center (REQUIRED, use 0)"
    • changedInput schema / properties / elements / items / properties / startBinding / properties / gap / description
      Previous value: -"Gap from shape edge in pixels (default: 8)"New value: +"Gap from shape edge in pixels (REQUIRED, use 8)"
    • addedInput schema / properties / elements / items / properties / startBinding / required
      Added value: +[
      +  "elementId",
      +  "focus",
      +  "gap"
      +]
  9. Changed1 schema field changed
    • changedInput schema / properties / elements / items / properties / fontFamily / description
      Previous value: -"Font family: 1=Virgil, 2=Helvetica, 3=Cascadia (default: 1)"New value: +"Font family: 5=Excalifont, 6=Nunito, 7=Lilita One, 8=Comic Shanns (default: 5)"
  10. Changed4 schema fields changed
    • addedOutput schema / properties / appState
      Added value: +{
      +  "description": "Current app state (viewBackgroundColor, etc.)",
      +  "type": "object"
      +}
    • addedOutput schema / properties / collabUrl
      Added value: +{
      +  "description": "Collaboration server URL for Socket.IO",
      +  "type": "string"
      +}
    • addedOutput schema / properties / elements
      Added value: +{
      +  "description": "Current scene elements for inline SVG rendering",
      +  "type": "array"
      +}
    • addedOutput schema / properties / pendingMermaid
      Added value: +{
      +  "description": "Mermaid definition to be rendered client-side",
      +  "type": "object"
      +}
  11. First observed

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=false and destructiveHint=false, but the description adds material behavior the annotations cannot express: the call silently creates a whole new canvas when room_id is absent, and arrows auto-bind within a 30px edge tolerance. It does not describe the return payload, but an output schema exists to cover that. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and organized with clear labels (TEXT IN SHAPES, ARROWS, Colors), but the long HTML-subset enumeration duplicates the same block already present in the elements.text schema description, so a sizeable fraction of the text does not earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a rich input schema, an output schema, and non-destructive annotations, the description covers the remaining gaps an agent would need: mode selection, element type inventory, rich-text constraints, and shape-to-text binding. Only minor gaps remain, such as coordinate origin/conventions and how image fileId is obtained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so per-element fields are already documented in detail, and much of the description's parameter content (colors in hex, the rich-text HTML subset, containerId for text-in-shape, arrow edge positioning) is repeated nearly verbatim from the schema. It does add cross-field guidance (textAlign usage, avoid unsupported HTML/CSS), but the baseline applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Creates elements on a canvas') and immediately clarifies the dual mode: creates a new canvas when room_id is omitted, appends to an existing one when provided. It also names the sibling to avoid (add_elements_from_mermaid), so an agent can route correctly without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit use cases (wireframes, UI mockups, freeform illustrations, standalone shapes, manual layouts) and an explicit exclusion with the alternative named: 'For diagrams Mermaid can express, use add_elements_from_mermaid instead.' The room_id rule for continuing an existing canvas is also stated as a decision rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources