Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.
Use sql_db_list_tables tool to see all available tables in the database.
This returns the complete list of tables you can query.
Use sql_db_schema tool with table names to examine:
Identify how tables connect:
Provide clear information about:
Step 1: Use sql_db_list_tables
Response:
The Chinook database has 11 tables:
1. Artist - Music artists
2. Album - Music albums
3. Track - Individual songs
4. Genre - Music genres
5. MediaType - File formats (MP3, AAC, etc.)
6. Playlist - User-created playlists
7. PlaylistTrack - Tracks in playlists
8. Customer - Store customers
9. Employee - Store employees
10. Invoice - Customer purchases
11. InvoiceLine - Individual items in invoices
Step 1: Use sql_db_schema with table name "Customer"
Response:
The Customer table has these columns:
- CustomerId (INTEGER) - Primary key, unique customer ID
- FirstName (NVARCHAR) - Customer's first name
- LastName (NVARCHAR) - Customer's last name
- Company (NVARCHAR) - Company name (optional)
- Address, City, State, Country, PostalCode - Location fields
- Phone (NVARCHAR) - Phone number
- Fax (NVARCHAR) - Fax number
- Email (NVARCHAR) - Email address
- SupportR...