Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
langchain-ai avatar

Schema Exploration

  • 1.1k installs
  • 27.3k repo stars
  • Updated August 5, 2026
  • langchain-ai/deepagents

schema-exploration is an agent skill that lets a coding agent safely map SQL database tables, columns, data types, and foreign-key relationships before writing queries or features.

About

schema-exploration is a Deep Agents skill that standardizes read-only database reconnaissance before any query or feature code ships. Step one calls sql_db_list_tables to return every available table. Step two invokes sql_db_schema with selected table names to surface column names, data types such as INTEGER, TEXT, and DATETIME, and relationship hints. The skill triggers when users ask about schema, ERDs, foreign keys, or how entities relate. Developers reach for schema-exploration when onboarding to an unfamiliar Postgres, MySQL, or SQLite database and need the agent to inspect structure instead of guessing table names. The workflow is intentionally non-destructive—list and describe only—so agents build accurate SQL and API layers on verified metadata.

  • Automatically lists all tables using sql_db_list_tables
  • Retrieves full column definitions, data types, primary keys, foreign keys and sample rows via sql_db_schema
  • Maps entity relationships by detecting Id columns and foreign key patterns
  • Delivers clear explanations of tables, columns, relationships and sample data
  • 3-step repeatable workflow: list → schema → map relationships

Schema Exploration by the numbers

  • 1,096 all-time installs (skills.sh)
  • +44 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #87 of 911 Databases skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/langchain-ai/deepagents --skill schema-exploration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.1k
repo stars27.3k
Security audit3 / 3 scanners passed
Last updatedAugust 5, 2026
Repositorylangchain-ai/deepagents

How do you explore an unknown SQL database schema safely?

Let their coding agent safely explore any SQL database structure before writing queries or building features.

Who is it for?

Developers onboarding to an unfamiliar SQL database who need the agent to inspect tables and keys before writing queries.

Skip if: NoSQL document stores without SQL metadata tools or tasks that require mutating schema or seeding data.

When should I use this skill?

The user asks what tables exist, requests column types, mentions ERD or foreign keys, or wants entity relationship mapping.

What you get

Table inventory, per-table column and type definitions, and documented foreign-key entity relationships.

  • table inventory
  • column type map
  • foreign-key relationship notes

Files

SKILL.mdMarkdownGitHub ↗

Schema Exploration Skill

Workflow

1. List All Tables

Use sql_db_list_tables tool to see all available tables in the database.

This returns the complete list of tables you can query.

2. Get Schema for Specific Tables

Use sql_db_schema tool with table names to examine:

  • Column names - What fields are available
  • Data types - INTEGER, TEXT, DATETIME, etc.
  • Sample data - 3 example rows to understand content
  • Primary keys - Unique identifiers for rows
  • Foreign keys - Relationships to other tables

3. Map Relationships

Identify how tables connect:

  • Look for columns ending in "Id" (e.g., CustomerId, ArtistId)
  • Foreign keys link to primary keys in other tables
  • Document parent-child relationships

4. Answer the Question

Provide clear information about:

  • Available tables and their purpose
  • Column names and what they contain
  • How tables relate to each other
  • Sample data to illustrate content

Example: "What tables are available?"

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

Example: "What columns does the Customer table have?"

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
- SupportRepId (INTEGER) - Foreign key to Employee table

Sample data shows customers like:
- Luís Gonçalves from Brazil
- Leonie Köhler from Germany
- François Tremblay from Canada

Example: "How do I find revenue by artist?"

Step 1: Identify tables needed

  • Artist (has artist names)
  • Album (links artists to tracks)
  • Track (links albums to sales)
  • InvoiceLine (has sales data)
  • Invoice (has revenue totals)

Step 2: Map relationships

Artist (ArtistId)
  ↓ 1:many
Album (ArtistId, AlbumId)
  ↓ 1:many
Track (AlbumId, TrackId)
  ↓ 1:many
InvoiceLine (TrackId, UnitPrice, Quantity)

Response:

To find revenue by artist, you'll need to:
1. Start with the Artist table
2. JOIN to Album on ArtistId
3. JOIN to Track on AlbumId
4. JOIN to InvoiceLine on TrackId
5. SUM the revenue (UnitPrice * Quantity)
6. GROUP BY artist name

This requires the query-writing skill to execute.

Quality Guidelines

For "list tables" questions:

  • Show all table names
  • Add brief descriptions of what each contains
  • Group related tables (e.g., music catalog, transactions, people)

For "describe table" questions:

  • List all columns with data types
  • Explain what each column contains
  • Show sample data for context
  • Note primary and foreign keys
  • Explain relationships to other tables

For "how do I query X" questions:

  • Identify required tables
  • Map the JOIN path
  • Explain the relationship chain
  • Suggest next steps (use query-writing skill)

Related skills

FAQ

Which tools does schema-exploration use?

schema-exploration uses sql_db_list_tables to enumerate tables and sql_db_schema to return column names, data types, and foreign-key relationship metadata for selected tables.

Is schema-exploration safe on production databases?

schema-exploration is read-only—it lists tables and describes schemas without mutating data, making it suitable for pre-query reconnaissance on unfamiliar SQL databases.

When should schema-exploration run?

Run schema-exploration when the user asks about database schema, table structure, column types, foreign keys, ERDs, or how entities relate before writing SQL or features.

Databasesbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.