Skip to main content
Glama

add_connection

Adds a connection (arrow/edge) between two nodes or containers in a live Trident document. Draw an edge as soon as both of its ends exist — do not save the connections for the end (draw_group does this for you). Use get_document_summary to get valid source and target IDs before calling this. Requires a valid editor access token. For ERD relationships, connect the two TABLE containers (field rows are rejected as endpoints) and set type to an ERD pair such as "one_to_many".

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>",
      "connection": "<connection>"
    },
    "name": "add_connection"
  }
}

Input Schema

NameRequiredDescriptionDefault
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]".
connectionYes
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 / connection / properties / routingMode / description
      Previous value: -"Optional: routing algorithm (e.g. \"straight\", \"bezier\", \"orthogonal\")"New value: +"Optional: routing algorithm: \"straight\" (default), \"bezier\", or \"orthogonal\". Avoid \"orthogonal\" unless the user asks for it: edges on one side of a node share a single port, so right-angle paths overlap."
    • changedInput schema / properties / connection / properties / type / description
      Previous value: -"Optional: connection type. Line styles: \"arrow\" (default), \"line\", \"thick_arrow\", \"dashed_arrow\", \"dotted_arrow\", \"wave\". ERD relationship pairs \"<source>_to_<target>\", each end one of one | many | zero_or_one | zero_or_many | one_or_many — e.g. \"one_to_many\", \"one_to_zero_or_many\", \"many_to_many\", \"one_to_one\". ERD pairs are solid lines with crow's-foot markers at each end."New value: +"Optional: connection type. Line styles: \"arrow\" (default), \"line\", \"thick_arrow\", \"dashed_arrow\", \"dotted_arrow\", \"wave\" (avoid unless the user asks for it: renders as a thick ribbon that hides labels). ERD relationship pairs \"<source>_to_<target>\", each end one of one | many | zero_or_one | zero_or_many | one_or_many — e.g. \"one_to_many\", \"one_to_zero_or_many\", \"many_to_many\", \"one_to_one\". ERD pairs are solid lines with crow's-foot markers at each end."
  2. Changed1 schema field changed
    • changedInput schema / properties / connection / properties / type / description
      Previous value: -"Optional: connection type (e.g. \"dotted\", \"dashed\", \"bold\", \"wave\")"New value: +"Optional: connection type. Line styles: \"arrow\" (default), \"line\", \"thick_arrow\", \"dashed_arrow\", \"dotted_arrow\", \"wave\". ERD relationship pairs \"<source>_to_<target>\", each end one of one | many | zero_or_one | zero_or_many | one_or_many — e.g. \"one_to_many\", \"one_to_zero_or_many\", \"many_to_many\", \"one_to_one\". ERD pairs are solid lines with crow's-foot markers at each end."
  3. Changed2 schema fields changed
    • changedInput schema / properties / connection / properties / routingMode / description
      Previous value: -"Optional: routing algorithm (e.g. \"straight\", \"orthogonal\")"New value: +"Optional: routing algorithm (e.g. \"straight\", \"bezier\", \"orthogonal\")"
    • changedInput schema / properties / connection / properties / type / description
      Previous value: -"Optional: connection type (e.g. \"dotted\", \"dashed\", \"bold\")"New value: +"Optional: connection type (e.g. \"dotted\", \"dashed\", \"bold\", \"wave\")"
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the write profile is already known; the description adds the auth requirement (valid editor access token) and endpoint validation rules (field rows rejected, ERD pairs must connect TABLE containers). It does not say what happens when an ID is invalid or a duplicate id is supplied, which leaves a gap for a non-idempotent mutation.

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 core action, then timing, prerequisite and a special case in a tight sequence with no filler. It is dense at four sentences but every clause carries an actionable constraint.

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?

For a nested-object mutation with no output schema, it covers auth, ID sourcing, endpoint validity, draw timing and the ERD special case. Missing only the return shape (e.g. whether the generated connection id comes back) and failure behavior.

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 coverage is 80% so the baseline is 3, but the description adds meaning not present in the schema: source/target must be container IDs rather than field rows, and the ERD pair format is tied to a concrete modeling intent. It still defers the full list of line styles and routing modes to 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 a connection (arrow/edge) between two nodes or containers') and names the differentiating sibling (draw_group) so an agent can separate the two without opening a 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 timing ('draw an edge as soon as both of its ends exist'), an explicit when-not ('do not save the connections for the end'), names the alternative that handles that case (draw_group), and states the prerequisite step (get_document_summary for valid IDs).

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.