Skip to main content
Glama
C4 Diagram MCP Server

C4 Diagram MCP Server

by tarastclair

create-interfaces-visualization

Adds a C4-styled interfaces diagram to an existing architecture project, visualizing interfaces, types, enums, and their relationships to document complex type systems and API contracts.

Instructions

Create a new C4-styled interfaces visualization 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.

An interfaces diagram is a specialized C4-styled visualization that shows your type system in a 
comprehensible format, with clear styling for interfaces, types, enums, and the relationships 
between them. It's ideal for documenting complex type systems and API contracts.

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

Benefits:
- Automatic PlantUML code generation with consistent C4 styling
- Clear visualization of interfaces, types, and their relationships
- Customized styling to distinguish between different element types

Required Input Fields:
- projectId: String (ID of the project to add this diagram to)
- title: String (The name of your interfaces 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 interfaces/ 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-interfaces-visualization"
  }
}

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.2/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 that PlantUML is auto-generated with consistent C4 styling, that the diagram is written to the project's interfaces/ directory, that the response returns unique IDs needed for subsequent operations, and that generate-diagram-image must be called to get a PNG. It omits error/duplicate-title behavior and any permission or quota considerations.

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?

Headers and numbered prerequisites make it skimmable and the critical 'IMPORTANT' prerequisite block is well placed, but it is roughly 300 words with a 'Benefits' bullet list that is marketing framing rather than operational guidance. The Required/Optional Input Fields section duplicates a schema that is already 100% described, so several sentences do not earn their place.

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 creation tool with no annotations and no output schema, the description covers what an agent needs: prerequisites, side effects (file location), the returned fields (message, projectId, elementIds), and the required terminal step to render an image. Only failure modes and the choice among sibling diagram types are left unaddressed.

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 description coverage is 100%, so the schema already covers all three parameters at baseline 3. The description earns an increment by adding real meaning the schema lacks — how to obtain projectId (returned by project creation, or found in a note inside the existing project's PUML source) — though its per-field restatements are largely redundant.

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-styled interfaces visualization diagram within an existing architecture project') and then characterizes what makes this diagram type distinct: it 'shows your type system ... with clear styling for interfaces, types, enums, and the relationships between them.' That lets an agent distinguish it from the other create-*-diagram siblings without opening the 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?

Explicitly routes mutations of existing diagrams to update-element and update-relationship, and spells out prerequisites (a projectId from project creation or from a note in existing PUML source). It also outlines the follow-on workflow (add-element, add-relationship, then generate-diagram-image). It does not say when to prefer this diagram type over the component/container/context/sequence diagram siblings, which is the main gap.

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