queryContext
queryContextBuild multi-table SQL-authoring context from natural-language terms or an explicit table list. Use when relevant tables are unknown or a request spans several tables.
Instructions
Build multi-table SQL-authoring context from natural-language terms or an explicit table list. Use when relevant tables are unknown or a request spans several tables; for one known table's fields or structure, use describeTable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| terms | No | User terms, e.g. 'customers order totals'. | |
| schema | No | ||
| tables | No | Force-include tables (CSV), e.g. customers,orders. | |
| maxTables | No | Tables to include (default 12). | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| includeSamples | No | Include up to 3 rows per table (default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| terms | No | Natural-language terms used to select relevant schema context. | |
| schema | No | ||
| tables | No | Tables included in this context, graph, query inspection, or usage record. | |
| joinPaths | No | Shortest or suggested join paths between selected tables. | |
| tableCount | Yes | Number of tables selected into the query context. | |
| relationships | No | Relationship edges relevant to the context, graph, or observed-relationships result. | |
| includeSamples | Yes | True when small sample rows were requested for selected tables. | |
| requestedTables | No | Explicit table names requested by the caller for query context. | |
| semanticMatches | No | Tables matched by semantic usage-catalog terms before final context assembly (opaque). |