Skip to main content
Glama
C4 Diagram MCP Server

C4 Diagram MCP Server

by tarastclair

create-container-diagram

Creates a C4 Level 2 Container diagram in an existing project to show a system's containers, their responsibilities, and interactions.

Instructions

Create a new C4 Container diagram within an existing architecture project.

If you need to make changes to an existing diagram, use the update-element and update-relationship tools instead.

A Container diagram (C4 Level 2) zooms into a software system to show the containers (applications, data stores, microservices, etc.) that make up that system. Use this to show how system responsibilities are distributed across containers and how these containers communicate.

IMPORTANT: Before using this tool, you will need either:
- the project ID returned from the create-c4-project tool
- to locate the project ID of an existing project; In this case, the projectId can be found in a note within the PUML source code for each diagram in the existing project

DO NOT create a new project if you have access to an existing project ID. Reusing the same project ID ensures proper relationships between different diagram levels.

Benefits:
- Shows the high-level technical building blocks and their interactions
- Clarifies the architecture without going into implementation details
- Helps identify major technology decisions required

Required Input Fields:
- projectId: String (ID of the project to add this diagram to)
- title: String (The name of your system/diagram)

Optional Input Fields:
- description: String (A brief explanation of what the diagram represents)

The response will include unique IDs that you'll need for all subsequent operations,
and the diagram will be saved in your project's container/ directory.

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

You can 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>",
      "title": "<title>"
    },
    "name": "create-container-diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleYesTitle for the new diagram
projectIdYesID of the project to add this diagram to
descriptionNoOptional description of what the diagram represents

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and mostly meets it: it discloses the write location (container/ directory), the fact that the response returns IDs needed for all subsequent operations, and the required workflow ordering. What it does not state is whether the call is reversible, what permissions or quota limits apply, or what happens if the projectId is invalid, so mutation risk is only partially characterized.

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?

Structure is good and the essential constraint is front-loaded, but the definition is padded: the Required/Optional Input Fields block duplicates the schema verbatim, and the three-item Benefits list ('helps identify major technology decisions') adds little decision value. The Response Fields block also contains a copy-paste artifact describing 'message' as being 'about the update' in a create tool.

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?

For a three-parameter creation tool with no output schema and no annotations, the description covers everything an agent needs: prerequisite acquisition of the project ID, the full downstream tool sequence, and an explicit enumeration of response fields. Nothing material for correct invocation is missing.

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 projectId, title, and description. The description restates the same three fields in Required/Optional lists without adding format, constraint, or syntax detail (for example, uniqueness rules for title), so a baseline 3 is correct.

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 first sentence states a specific verb and resource (create a C4 Container diagram) and scopes it to an existing architecture project. The description goes further by defining what a Container diagram is (C4 Level 2, containers that make up a system), which lets an agent distinguish it from create-context-diagram and create-component-diagram without opening their schemas.

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?

Explicit routing is provided: use update-element and update-relationship to modify an existing diagram rather than creating a new one, and use add-element/add-relationship followed by generate-diagram-image to build it out. Prerequisites and a negative constraint are also stated (do not create a new project when an existing project ID is available, surfaced in caps), which is exactly the highest tier of guidance.

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