---
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/create-entity-relationship-diagrams/copilot
---
# How to Create ER Diagrams with Copilot

Copilot generates ER diagrams from your schema definitions, reading Prisma, Drizzle, or SQL migration files to produce accurate visual representations of your database. Keep schema documentation in sync with your actual data model by regenerating diagrams whenever migrations change.

## Setup

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

## Steps

1. Add ToolRouter to Copilot MCP config
2. In Copilot Chat: "Create an ER diagram from my database schema" and describe or paste the schema
3. Copilot generates the ER diagram with all relationships
4. Ask: "Save the diagram next to my migration files"

## Example Prompt

```
Generate an ER diagram from my Prisma schema file showing all models, their fields, and the relationships between them.
```

## Tips

- Copilot can read your Prisma, Drizzle, or SQL migration files and generate the ER diagram directly
- Keep the ER diagram updated alongside schema changes in your repo
