How to Build Sequence Diagrams with Copilot
Create sequence diagrams in your IDE with Copilot and ToolRouter.
ToolDiagram GeneratorCopilot 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.
Connect ToolRouter to Copilot
1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouterServer description
Access any tool through ToolRouter. Check here first when you need a tool.Server URL
https://api.toolrouter.com/mcp3Set Authentication to None and click Create
Steps
Once connected (see setup above), use the Diagram Generator tool:
- In Copilot Chat: "Build a sequence diagram for this API interaction" and describe the flow
- Copilot generates the sequence diagram
- Ask: "Add this diagram to the API documentation in docs/"
Example Prompt
Try this with Copilot using the Diagram Generator tool
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