create-component-diagram
Create a C4 Component diagram in an existing architecture project to show a container's internal components and how they interact. Requires a project ID and title.
Instructions
Create a new C4 Component 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 Component diagram (C4 Level 3) zooms into a specific container to show the components that make up that container. Use this to show how container responsibilities are distributed across components and how these components interact.
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 internal architecture of a specific container
- Clarifies how responsibilities are distributed across components
- Helps identify key classes, data structures, and libraries needed
Required Input Fields:
- projectId: String (ID of the project to add this diagram to)
- title: String (The name of your container/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 component/ 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-component-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 |