draw_sequence
Draw a sequence diagram (who sends what to whom, in order) in the chat. YOU write it as Mermaid sequenceDiagram text (first line "sequenceDiagram"; "participant S as Server"; arrows A->>B: text for a call and B-->>A: text for a reply). This tool returns a finished diagram that the view draws inline (MCP Apps hosts; elsewhere the text fallback lists the messages). Call it with the Mermaid you wrote and show the result as it is: do not edit, re-encode or re-send the returned block, and do not pass it to render_surface. If it is refused, the message names the line and what to fix; correct the Mermaid and call again. Limits: 8192 bytes, at most 6 actors and 14 messages; longer flows should be split into several diagrams (one per phase). Supported: participant/actor (with "as" aliases), implicit participants, ->>, -->>, -), ->, -->, autonumber, title. activate/deactivate are ignored (not drawn). Not supported: Note, loop/alt/opt/par/critical/rect blocks. Labels are plain text (60 characters), no HTML or links.
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": {
"mermaid": "<mermaid>"
},
"name": "draw_sequence"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Optional title shown above the diagram (plain text, 80 characters at most). A "title" line in the Mermaid is used when this is absent. | |
| mermaid | Yes | Mermaid sequenceDiagram text you wrote, for example: sequenceDiagram\n participant U as User\n participant A as Auth service\n U->>A: Log in\n A-->>U: Token |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Diagram title. | |
| blocks | Yes | One laid-out sequence block for the view. |