---
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/copilot
---
# How to Build Sequence Diagrams with Copilot

Copilot creates sequence diagrams right next to your API code, making it easy to document service interactions as you build them. Visualize webhook delivery flows, authentication sequences, and multi-service call chains for your API documentation and PR descriptions.

## Setup

{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

## Steps

1. Add ToolRouter to Copilot MCP config
2. In Copilot Chat: "Build a sequence diagram for this API interaction" and describe the flow
3. Copilot generates the sequence diagram
4. Ask: "Add this diagram to the API documentation in docs/"

## Example Prompt

```
Create a sequence diagram for the webhook delivery flow in our system: event occurs, webhook service queues delivery, worker picks up job, sends HTTP POST to subscriber, records response, retries on failure.
```

## Tips

- Copilot can read your API route handlers and infer the sequence of service calls
- Include sequence diagrams in PR descriptions to explain multi-service changes visually
