---
title: ToolRouter — Agent Use Case Guide
description: Step-by-step guide for completing a task with a specific AI agent using ToolRouter.
url: https://toolrouter.com/tools/diagram-generator/use-cases/build-sequence-diagrams/claude
---
# How to Build Sequence Diagrams with Claude

Claude designs sequence diagrams through conversation about your service interactions. Describe the main flow, then add alternative paths, timeout scenarios, and retry logic through follow-ups. The iterative approach ensures the diagram captures real-world complexity including the failure modes that simple descriptions miss.

## Setup

claude mcp add toolrouter -- npx -y toolrouter-mcp

## Steps

1. Connect ToolRouter: claude mcp add toolrouter -- npx -y toolrouter-mcp
2. Ask Claude: "Create a sequence diagram using diagram-generator" and describe the interaction
3. Claude generates the diagram showing participants, messages, and responses
4. Download the diagram for your API docs or design review

## Example Prompt

```
Create a sequence diagram for our OAuth2 flow: user clicks login, browser redirects to auth provider, user authenticates, auth provider redirects back with code, our server exchanges code for token, server creates session, browser receives session cookie.
```

## Tips

- Name each participant clearly -- "Browser", "API Gateway", "Auth Service" rather than generic labels
- Ask Claude to add error paths showing what happens when a step fails
