Skip to main content
Glama
C4 Diagram MCP Server

C4 Diagram MCP Server

by tarastclair

create-context-diagram

Creates a C4 Level 1 Context diagram within an existing architecture project to give stakeholders a high-level view of users, the system, and external dependencies.

Instructions

Create a new C4 Context 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 Context diagram (C4 Level 1) shows your system in its environment, focusing on people and systems rather than technologies or implementation details. Use this when you need a high-level overview that stakeholders can easily understand.

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:
- Automatic PlantUML code generation without needing to write syntax
- Shows your system, its users, and external system dependencies
- Perfect for explaining the big picture to executives and stakeholders

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 context/ 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-context-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.4/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 does reasonably well: it discloses the prerequisite state (must already have a project), the side effect (diagram saved in the project's context/ directory), the response payload, and the mandatory follow-up call to generate-diagram-image. It stops short of stating failure modes when projectId is invalid or how the diagram relates to existing elements in the same project.

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 logical and front-loaded (purpose, when-to-use, prerequisites, next steps), but it is bloated for a three-parameter tool. The 'Benefits' bullet list is marketing content, and the 'Required Input Fields' / 'Optional Input Fields' blocks largely duplicate the input schema rather than adding information.

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?

Because there is no output schema, documenting the response fields (message, projectId, elementIds) is genuinely necessary and is done well, as is the workflow tail-end: add-element / add-relationship, then generate-diagram-image. Minor gaps remain around error behavior and the ambiguous reference to "create-c4-project", which does not exactly match the sibling name locate-or-create-c4-project.

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 already 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it tells the agent where projectId comes from (a note inside the PUML source of each existing diagram) and that title names the system/diagram. The description field guidance is essentially a restatement of 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 ("Create a new C4 Context diagram") and scopes it to an existing architecture project. It goes further by defining what a Context diagram is (C4 Level 1, people and systems, not technologies), which implicitly separates it from the sibling create-component-diagram / create-container-diagram / create-sequence-diagram tools. The sibling it is not (update-element / update-relationship) is named explicitly.

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 when-to-use ("when you need a high-level overview that stakeholders can easily understand") and when-not (editing an existing diagram belongs to update-element / update-relationship). It also gives the hard prerequisite — a projectId — with two concrete ways to obtain it, plus the rule not to create a redundant project.

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