Skip to main content
Glama
C4 Diagram MCP Server

C4 Diagram MCP Server

by tarastclair

update-relationship

Modify an existing relationship in a C4 diagram by changing its source, target, description, or technology; use it when a user requests edits to an existing diagram.

Instructions

Update an existing relationship in an existing C4 diagram. This tool should be used WHENEVER a user requests changes to existing relationships rather than creating new diagrams.

Required Input Fields:
- projectId: String (UUID from create-c4-project)
- diagramId: String (UUID from create-context-diagram)
- relationshipId: String (UUID of the relationship to update)

Optional Input Fields:
- sourceId: String (UUID of the new source element)
- targetId: String (UUID of the new target element)
- description: String (New description for the relationship)
- technology: String (New technology used in the relationship)

The response will include unique IDs that you'll need for all subsequent operations,
as well as a state object that will direct you to the appropriate next step to take.

Response Fields:
- message: String (User-friendly message about the update)
- projectId: String (UUID of the project)
- elementIds: Object (Mappings of element UUIDs to their names)

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": {
      "projectId": "<projectId>",
      "diagramId": "<diagramId>",
      "relationshipId": "<relationshipId>"
    },
    "name": "update-relationship"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceIdNoUUID of the new source element
targetIdNoUUID of the new target element
diagramIdYesUUID of the diagram from create-context-diagram
projectIdYesUUID of the project from create-c4-project
technologyNoNew technology used in the relationship
descriptionNoNew description for the relationship
relationshipIdYesUUID of the relationship to update

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose that the response carries IDs and a 'state object' that directs the next step, which is genuine chaining context, but it never states whether omitted optional fields are left unchanged or cleared, whether the change is reversible, or what permissions are needed. The listed response fields (message, projectId, elementIds) also sit oddly against the prior claim about 'unique IDs you'll need for all subsequent operations', leaving the return behavior muddled.

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?

Purpose and trigger condition are correctly front-loaded and the field grouping is scannable. However, a full re-listing of seven parameters that the schema already documents at 100% coverage, plus a response-field list that conflicts with the preceding sentence, is padding that does not earn its place.

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

Completeness3/5

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

For a seven-parameter mutation tool with no annotations and no output schema, the description covers the inputs but leaves key gaps: update semantics for optional fields, side effects, and error conditions. The response description is incomplete relative to the complexity, listing only elementIds while promising IDs for subsequent operations.

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 description coverage is 100%, so the schema already documents all seven parameters, and the description's field list largely restates it verbatim, including the same provenance hints. It adds no semantics the schema lacks, most notably the partial-update question: whether supplying only description leaves technology untouched.

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

Purpose4/5

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

States a specific verb and resource ('Update an existing relationship in an existing C4 diagram'), which is clearly distinct from element-level operations. It gestures at the create-vs-update split ('rather than creating new diagrams') but never names the closest sibling, add-relationship, so the boundary is inferred rather than stated.

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?

Provides an explicit trigger condition ('WHENEVER a user requests changes to existing relationships') with emphasis, which is stronger than most. It stops short of negative guidance: it does not say to use add-relationship for new edges or update-element for element-level edits, so the agent must infer those exclusions.

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