add-element
Adds any C4 diagram element (person, system, container, component, boundary, note, or interface) to a specified project diagram for architecture modeling.
Instructions
Add an element to a C4 diagram.
This tool allows you to add any type of element (person, system, container, component, boundary)
to your C4 diagrams. The required parameters vary based on the element type and variant.
Required Input Fields:
- projectId: String (UUID of the project)
- diagramId: String (UUID of the diagram)
- elementType: String (Type of element: "note", "person", "system", "container", "component", "boundary", "interface", "type", "enum", "divider", "group")
- variant: String (Variant of the element: "standard", "external", "db", "queue", "system", "container")
- name: String (Name of the element)
- description: String (Description of the element)
Conditional Input Fields:
- technology: String (Required for container and component entities)
- boundaryId: String (Optional UUID of the boundary element this element belongs to)
- sprite: String (Optional icon for the element)
- tags: String (Optional styling tags)
- link: String (Optional URL link)
- type: String (Optional type specifier, for boundaries can be "system" or "container")
Response Fields:
- message: String (User-friendly message about the update)
- projectId: String (UUID of the project)
- elementIds: Object (Mappings of element IDs)
You can continue to 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>",
"diagramId": "<diagramId>",
"elementType": "<elementType>",
"variant": "<variant>",
"name": "<name>",
"description": "<description>"
},
"name": "add-element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| link | No | Optional URL link | |
| name | Yes | Name of the element | |
| tags | No | Optional styling tags | |
| type | No | Optional type specifier, for boundaries can be 'system', or 'container' | |
| sprite | No | Optional icon for the element | |
| variant | Yes | Variant of the element | |
| diagramId | Yes | UUID of the diagram | |
| projectId | Yes | UUID of the project | |
| boundaryId | No | UUID of the boundary element this element belongs to | |
| technology | No | Technology used (required for container and component entities) | |
| description | Yes | Description of the element | |
| elementType | Yes | Type of element to add |