Summarize table
summarize_tableReturns a one-stop table snapshot with columns, keys, constraints, indexes, storage/row-count/vacuum stats, and optional sample rows. Use it to inspect structure and health in one call.
Instructions
Return a one-stop snapshot of a table: columns, primary key, foreign keys, every other constraint, indexes, storage + row-count + last-vacuum/analyze stats, and (optionally) a short sample of rows. Replaces what would otherwise be 4-5 individual tool calls. Set sample_rows=0 on wide / jsonb-heavy tables where the sample isn't useful.
Example: summarize_table(schema='public', table='users', sample_rows=5)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"schema": "<schema>",
"table": "<table>"
},
"name": "summarize_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | Yes | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| sample_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes | ||
| table | Yes | ||
| schema | Yes | ||
| columns | Yes | ||
| indexes | Yes | ||
| constraints | Yes | ||
| primary_key | Yes | ||
| sample_rows | Yes | ||
| foreign_keys | Yes |