Skip to main content
Glama

add_node

Adds ONE node to a live Trident document — for small edits to an existing diagram. To build a region (a container with its nodes and edges) use draw_group instead. The node appears immediately for all collaborators. The result reports where things landed: "placed" (centre x/y and size w/h), the "container" box grown around its nodes, "overlaps" when something landed on top of something else, "nextFree" (top-left corners of clear space to the right of and below the whole diagram — positions are centres, so add half your region's width/height), and sometimes a "hint" — act on it. Requires a valid editor access token. Before adding nodes: call open_document to understand the diagram layout and pick sensible positions; call get_document_summary to get all existing entity IDs so you can avoid duplicates. IMPORTANT: if this node belongs inside a container, pass node.container on THIS call — do NOT create the node without a container and reparent it later via update_node. Orphaned nodes appear immediately to all live collaborators and create unnecessary visual churn.

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": {
      "token": "<token>",
      "agentId": "<agentId>",
      "node": "<node>"
    },
    "name": "add_node"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodeYesNode definition. ERD field rows: when node.container is an ERD table (a container with kind:"erd"), the node becomes that table's next row — give only id, label (e.g. "🔑 id", "🔗 user_id", "email") and container, and do NOT pass x/y: the row is placed and the table resized for you.
tokenYesEditor access token for this document. The document ID is embedded in the token.
agentIdYesYOUR AI assistant name (e.g. "Claude.ai", "GitHub Copilot"). Shown as "[agentId] working with [userName]" in the collaboration presence dot.
userNameNoFirst name of the human you are assisting (ask them at session start if you do not know). Shown in the collaboration presence dot as "[agentId] working with [userName]".
action_explanationNoOptional: brief explanation of what this action does and why (max 250 chars). Shown live to human collaborators in the AI cursor tooltip.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / node / properties / x / description
      Previous value: -"Optional: X position in diagram units"New value: +"X of the node's centre, in diagram units. Give the final position now rather than moving the node later. If you omit x/y the server slots the node into its container (or into clear space) and the result tells you where it landed — it never lands at the origin."
    • changedInput schema / properties / node / properties / y / description
      Previous value: -"Optional: Y position (screen coords — larger Y is lower on screen)"New value: +"Y of the node's centre (screen coords — larger Y is lower on screen). Give with x."
  2. Changed2 schema fields changed
    • changedInput schema / properties / node / description
      Previous value: -"Node definition"New value: +"Node definition. ERD field rows: when node.container is an ERD table (a container with kind:\"erd\"), the node becomes that table's next row — give only id, label (e.g. \"🔑 id\", \"🔗 user_id\", \"email\") and container, and do NOT pass x/y: the row is placed and the table resized for you."
    • changedInput schema / properties / node / properties / container / description
      Previous value: -"ID of the container this node belongs in. Set this NOW if you know the parent — do not create the node orphaned and reparent later with update_node. Treat this as required whenever the node has a logical parent container."New value: +"ID of the container this node belongs in. Set this NOW if you know the parent — do not create the node orphaned and reparent later with update_node. Treat this as required whenever the node has a logical parent container. If that container has an explicit width/height (a fixed size) and this node's position falls outside it, ALSO call update_container to enlarge the container (width/height, and x/y if needed) so the node fits — containers are centred on x/y, so their edges are at x ± width/2 and y ± height/2; leave ~40 units of padding. (The canvas grows the container on screen anyway, but the document keeps the old size until you resize it.)"
  3. Changed1 schema field changed
    • changedInput schema / properties / node / properties / shapeType / description
      Previous value: -"Optional: shape type, e.g. \"diamond\", \"rectangle\""New value: +"Optional: shape type. Default \"rectangle\"; \"diamond\" for decisions. Registered collections: Flowchart (\"flowchart-process\", \"flowchart-rounded\", \"flowchart-stadium\", \"flowchart-cylinder\", \"flowchart-circle\", \"flowchart-double-circle\", \"flowchart-decision\", \"flowchart-hexagon\", \"flowchart-parallelogram\", \"flowchart-trapezoid\", etc.), BPMN (\"bpmn-start-event\", \"bpmn-end-event\", \"bpmn-gateway\", \"bpmn-task\", \"bpmn-user-task\", \"bpmn-subprocess\", etc.; labels render under events/gateways), UML (\"uml-class\", \"uml-interface\", \"uml-package\", \"uml-component\", \"uml-database\", \"uml-actor\", \"uml-state\", \"uml-action\", etc.), General primitives (\"circle\", \"cylinder\", \"hexagon\", \"rounded-rect\", \"parallelogram\", \"trapezoid\", etc.), or Organic (\"cloud\", \"star\", \"heart\", etc.). Unknown values fall back to rectangle."
  4. Changed3 schema fields changed
    • addedInput schema / properties / node / properties / color
      Added value: +{
      +  "description": "Optional: background/fill color (hex like \"#438DD5\" or a color name). Set on THIS call — do not add the node and recolor it later with update_node.",
      +  "type": "string"
      +}
    • addedInput schema / properties / node / properties / outlineColor
      Added value: +{
      +  "description": "Optional: border/outline color (hex or color name).",
      +  "type": "string"
      +}
    • addedInput schema / properties / node / properties / textColor
      Added value: +{
      +  "description": "Optional: label text color (hex or color name), e.g. \"#FFFFFF\".",
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / node / properties / container / description
      Previous value: -"Optional: ID of a container to place this node inside"New value: +"ID of the container this node belongs in. Set this NOW if you know the parent — do not create the node orphaned and reparent later with update_node. Treat this as required whenever the node has a logical parent container."
  6. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true) it discloses real behavior: the node is visible immediately to all live collaborators, the call requires a valid editor access token, and orphaned nodes cause visible churn for collaborators. It also enumerates the result payload keys (placed, container, overlaps, nextFree, hint) and instructs acting on the hint. The main gap is that it does not say whether a failed/duplicate ID errors out or overwrites, which matters for a non-idempotent write.

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

Conciseness4/5

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

Front-loads the one-line purpose and the primary alternative before any detail, then proceeds through observed behavior, return values, prerequisites, and the container rule flagged with IMPORTANT. It is long for a single-tool description and repeats the 'do not reparent later' warning in prose that the schema also carries, but no sentence is pure filler.

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

Completeness5/5

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

No output schema exists, and the description compensates by naming each meaningful result key and how to interpret it, including the coordinate-centre caveat for nextFree. With auth requirements, collaboration side effects, ERD-row behavior covered by the schema, and the recommended call ordering spelled out, an agent has everything needed to invoke this correctly.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds genuine interpretive meaning: result positions are centres, so half the region's width/height must be added when using nextFree corners, and node.container should be supplied on this call rather than fixed later. It reinforces the container/x-y interplay rather than merely restating field names, though the per-field detail already lives in the schema.

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 ('Adds ONE node to a live Trident document') plus explicit scope ('for small edits to an existing diagram'), and immediately contrasts with the sibling that does the other thing ('To build a region ... use draw_group'). The capitalized ONE disambiguates it from bulk/single-region operations without needing the 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 when-to-use (small edits to existing diagrams), when-to-use-something-else (draw_group for regions), and named prerequisites with rationale (call open_document to understand layout, get_document_summary to avoid duplicate IDs). It also excludes a wrong sequencing pattern in bold ('do NOT create the node without a container and reparent it later via update_node'), which is exactly the guidance an agent needs to choose the right call sequence.

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.