Description
Discover the full database landscape in a single call. Returns all schemas with their tables nested inside, including table type, estimated row counts, disk sizes, column counts, index presence, and comments. Call this first when connecting to a new database. One call gives the AI everything it needs to understand the database structure before diving into specific tables.Parameters
This tool takes no parameters.Response schema
| Field | Type | Description |
|---|---|---|
schemas | array | Array of schema overview objects (see below) |
Schema overview object
| Field | Type | Description |
|---|---|---|
name | string | Schema name |
tables | array | Tables and views in this schema (see below) |
Table info object
| Field | Type | Description |
|---|---|---|
schema | string | Schema name |
name | string | Table or view name |
type | string | "table" or "view" |
row_estimate | integer | Estimated row count from pg_class |
total_bytes | integer | Total disk size in bytes (omitted for views) |
size_human | string | Human-readable size, e.g. "45 MB" (omitted for views) |
column_count | integer | Number of columns |
has_indexes | boolean | Whether the table has any indexes |
comment | string | Table comment from COMMENT ON or policy file (omitted if empty) |
Example response
Notes
- System schemas (
pg_catalog,information_schema,pg_toast) are always excluded. - When the
SCHEMASenvironment variable is set, only the allowed schemas and their tables are returned. See Schema Filtering. - Row estimates come from
pg_class.reltuplesand may be stale ifANALYZEhasn’t run recently. - Comments from a policy file are merged with Postgres
COMMENT ONvalues (Postgres comments take precedence). - This is typically the first tool an AI model calls when exploring a new database.