describe_table
Retrieve live column schemas, types, grain, and keying notes for a DuckDB table, or catalog all queryable tables, to write correct SQL without blocked DESCRIBE/SHOW.
Instructions
Schema catalog for every queryable DuckDB table (typed analytics tables, dims, raw mirrors): live columns + types plus curated grain and keying notes. No arg → catalog of all tables; table= (case-insensitive) → full detail. Use this instead of DESCRIBE/SHOW (blocked in run_sql). Complements describe_field (official field semantics for the 4 raw datasets).
Interpretation rules:
[grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.
[period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.
[sql_usage] Prefer purpose-built tools for supported questions. For custom SQL, use describe_table for grain/keying and describe_field for field definitions, then prefer typed tables. Raw mirrors are VARCHAR and need casts. run_sql enforces read-only access, not correct analytical grain: the caller must prevent join fan-out and choose the period/population. Disclose truncated results; use CSV/XLSX for the full result when needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | ||
| tables | No | ||
| columns | No | ||
| provenance | Yes | ||
| interpretation_rules | Yes |