Skip to main content
Glama
C4 Diagram MCP Server

C4 Diagram MCP Server

by tarastclair

add-element

Adds any C4 diagram element (person, system, container, component, boundary, note, or interface) to a specified project diagram for architecture modeling.

Instructions

Add an element to a C4 diagram.

This tool allows you to add any type of element (person, system, container, component, boundary) 
to your C4 diagrams. The required parameters vary based on the element type and variant.

Required Input Fields:
- projectId: String (UUID of the project)
- diagramId: String (UUID of the diagram)
- elementType: String (Type of element: "note", "person", "system", "container", "component", "boundary", "interface", "type", "enum", "divider", "group")
- variant: String (Variant of the element: "standard", "external", "db", "queue",  "system", "container")
- name: String (Name of the element)
- description: String (Description of the element)

Conditional Input Fields:
- technology: String (Required for container and component entities)
- boundaryId: String (Optional UUID of the boundary element this element belongs to)
- sprite: String (Optional icon for the element)
- tags: String (Optional styling tags)
- link: String (Optional URL link)
- type: String (Optional type specifier, for boundaries can be "system" or "container")

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

You can continue to use the add-element and add-relationship tools to design your diagram,
and when you're finished, you must call the generate-diagram-image tool to create
a png image of the completed diagram.

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>",
      "elementType": "<elementType>",
      "variant": "<variant>",
      "name": "<name>",
      "description": "<description>"
    },
    "name": "add-element"
  }
}

Input Schema

NameRequiredDescriptionDefault
linkNoOptional URL link
nameYesName of the element
tagsNoOptional styling tags
typeNoOptional type specifier, for boundaries can be 'system', or 'container'
spriteNoOptional icon for the element
variantYesVariant of the element
diagramIdYesUUID of the diagram
projectIdYesUUID of the project
boundaryIdNoUUID of the boundary element this element belongs to
technologyNoTechnology used (required for container and component entities)
descriptionYesDescription of the element
elementTypeYesType of element to add

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses required and conditional fields and response fields, but does not explain permissions, duplicate handling, validation failures, or whether adding an element has side effects beyond the immediate diagram modification.

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 description is front-loaded with purpose and then organized under clear required, conditional, and response headings. It is somewhat verbose and repeats schema content, but the structure remains useful for a 12-parameter tool.

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?

Given 12 parameters, no annotations, and no output schema, the description provides useful workflow and response-field context. However, the key claim that required parameters vary by element type and variant is not fully specified, leaving an important gap for correct invocation.

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 baseline is 3. The description adds value by separating required from conditional fields and noting that technology is required for container and component entities, but it also omits the schema's "generic" variant from its variant list and does not fully specify how required parameters vary by element type and variant.

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 description opens with a specific verb and resource: "Add an element to a C4 diagram." It also enumerates supported element types, making the tool's scope clear without needing to infer from the name alone.

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?

The description gives workflow context: use add-element and add-relationship to design the diagram, then call generate-diagram-image when finished. It does not explicitly distinguish when to use update-element instead of add-element, but the intended usage context is clear.

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