Add Diagram
add_diagramAttach a Mermaid diagram that explains the logic or structure behind a change, so the reviewer can follow it without reading the diff. OPTIONAL — add one only when it clarifies something a list of endpoints or screenshots cannot: a decision tree or branching rule, a multi-step flow, a state machine, a call sequence, or how the touched modules, tables or classes relate. Skip it for simple changes.
Types (first line of source): flowchart TD (decision trees, flows, dependency maps), stateDiagram-v2, sequenceDiagram, classDiagram, erDiagram. No %%{init} directives or click handlers.
Keep it small: about 15 nodes or fewer, short labels, one idea per diagram. Quote labels that contain punctuation, e.g. A["No tax line?"].
Mark what changed in flowcharts and state diagrams by tagging nodes :::added, :::changed or :::removed (e.g. B["Retry with backoff"]:::changed) — Damper colours them; do not add your own classDef colours.
Before/after: for a changed flow pass beforeSource with the previous diagram.
Upserts by key (default: slug of the title); calling again with the same key replaces the diagram. Never put secrets or real customer data in labels.
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>",
"taskId": "<taskId>",
"title": "<title>",
"source": "<source>"
},
"name": "add_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Stable identity (default: slug of the title). Reuse it to replace. | |
| group | No | Optional grouping label, e.g. the feature or module | |
| title | Yes | Short label, e.g. "VOD booking type by tax line" | |
| change | No | added = new endpoint/page, changed = existing one behaves or looks different, removed = gone (default: changed) | |
| source | Yes | Mermaid source, starting with the diagram type, e.g. "flowchart TD\n A[Start] --> B{Tax line?}" | |
| taskId | Yes | ||
| projectId | Yes | Project ID. Use list_projects to find available project IDs. | |
| description | No | What the diagram shows and what to check | |
| beforeSource | No | For changed flows: the Mermaid source before your change |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| artifact | Yes | ||
| replaced | Yes | ||
| dashboardUrl | No | Full dashboard URL of the affected resource |