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
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title for the new diagram | |
| projectId | Yes | ID of the project to add this diagram to | |
| description | No | Optional description of what the diagram represents |