Skip to main content
Glama

workflow_add_edge

Add an edge/connection between two nodes for execution flow.

IMPORTANT RULES:

  • There can only be ONE edge between any two nodes

  • Edges control EXECUTION FLOW, not data flow

  • Data connections are defined in target node's inputs (sourceNodeId, sourcePortId)

  • Default sourceFlowPortId is "output"

  • For IF_ELSE v2 nodes, use a CONDITIONS parameter ID or "else" as sourceFlowPortId

  • Example: {"workflowId":"invoice-flow","sourceNodeId":"fetch","targetNodeId":"save","sourceFlowPortId":"output"}

Use when editing a draft. Do not use to activate or run a candidate. Next step: validate, guard, save with workflow_save_version, then call workflow_test_run for a first version. Edits update one open draft; PII can be a warning, but new PII in agent or MCP saves blocks.

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": {
      "workflowId": "<workflowId>",
      "sourceNodeId": "<sourceNodeId>",
      "targetNodeId": "<targetNodeId>"
    },
    "name": "workflow_add_edge"
  }
}

Input Schema

NameRequiredDescriptionDefault
workflowIdYesThe workflow ID
sourceNodeIdYesThe ID of the source node
targetNodeIdYesThe ID of the target node
versionLabelNoOptional label for this version (e.g. "Connected nodes"). If omitted, defaults to "Version N".
sourceFlowPortIdNoThe ID of the source output port (default: "output")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare it is a non-destructive mutation; the description adds real behavioral context beyond that: a uniqueness constraint (only one edge between two nodes), the semantics that edges are execution flow not data flow, that edits apply to a single open draft, and that new PII on agent/MCP saves is blocking. The IF_ELSE v2 port rule is a concrete operational detail an agent could not infer elsewhere.

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?

The definition is front-loaded with purpose, then a bulleted rules block, then an example, then lifecycle guidance — a sensible order with no wasted sentences. Minor deductions for shouty emphasis ('IMPORTANT RULES', 'EXECUTION FLOW') and a final sentence about PII that is grammatically muddled and hard to parse on first read.

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 5-parameter mutation with annotations but no output schema, the description covers the constraints, defaults, and workflow sequencing an agent needs before calling it. It does not say what the call returns (no edge ID or confirmation shape) or what error surfaces when the uniqueness rule is violated, which matters slightly more given the absence of an output schema.

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 100%, so the baseline is 3; the description earns above that by explaining that sourceFlowPortId defaults to 'output' and, more importantly, that IF_ELSE v2 nodes require a CONDITIONS parameter ID or the literal 'else'. The worked JSON example reinforces the required-field combination, though it duplicates rather than extends the schema on workflowId/sourceNodeId/targetNodeId.

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?

The opening sentence names a specific verb and resource ('Add an edge/connection between two nodes') and immediately scopes it to execution flow rather than data flow, which cleanly separates it from workflow_add_node and from input-level data connections. An agent can distinguish it from workflow_delete_edge and workflow_get_edges without opening any schema.

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

Usage Guidelines4/5

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

It gives explicit lifecycle context ('Use when editing a draft', 'Do not use to activate or run a candidate') and lays out the follow-up sequence: validate, guard, save with workflow_save_version, then workflow_test_run. What is missing is a direct pointer to the inverse or sibling tool (workflow_delete_edge) for the case where an edge already exists and must be replaced.

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.