smart_query
Translates natural-language questions into SQL queries by analyzing schema, matching examples, and requesting clarification for ambiguous inputs.
Instructions
BIRD SQL-based intelligent query tool. Analyzes natural-language questions to (1) extract relevant schema, (2) match similar few-shot examples, (3) assess complexity, (4) request clarification for ambiguous questions. Call this tool before run_query. For a new data source, first inspect the schema with list_tables, then register keyword-to-table mappings via manage_keyword_map to significantly improve accuracy. Note: when ANTHROPIC_API_KEY is set, table-name lists (never query results or row data) may be sent to the Anthropic API as a fallback for table selection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_source_id | Yes | Data source ID (from list_data_sources) | |
| question | Yes | Natural-language question (e.g., 'How many payments were completed last month?') | |
| context | No | User's answer to a previous clarification question (for multi-turn) |