generate_diagram
Create a visual diagram from nodes and edges and save it into an existing CanvasKeep diagram; automatic layout handles positioning.
Instructions
Generate a visual diagram from a structured graph of nodes and edges, and save it to an existing CanvasKeep diagram.
You provide the logical structure (what components exist and how they connect), and CanvasKeep handles all visual layout automatically - do NOT try to compute x/y positions.
NODES: Create one node for every distinct component, actor, system, service, or data store mentioned in the user's request. Give each a short, clear label (under 30 chars). Choose the right type for visual distinction.
EDGES: Create one edge for every meaningful interaction, data flow, API call, or dependency between nodes. Label edges with the nature of the interaction (e.g. 'REST API', 'SQL query', 'WebSocket', 'publishes'). Every important relationship should be an edge.
MODE: Use 'replace' (default) to create a fresh diagram. Use 'append' to add new elements alongside existing content in the diagram.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'replace' clears existing content and draws only the new graph. 'append' adds the new graph alongside any existing diagram content. | replace |
| edges | Yes | Connections between nodes representing interactions, data flows, API calls, or dependencies. Each becomes a labeled arrow. | |
| nodes | Yes | Every distinct component, actor, system, or data store to show on the diagram. Each becomes a labeled box. | |
| direction | No | Layout direction. 'vertical' (default): top-to-bottom flow, best for sequential processes. 'horizontal': left-to-right. 'auto': picks based on max fan-out from any single node. | vertical |
| diagram_id | Yes | The diagram UUID to write the generated content into. Create one first with create_diagram if needed. |