context_for_question
Returns the semantic-layer context relevant to a natural-language question—tables, columns, keys, filters, metrics, routing guidance, and unconfirmed assumptions—so you can write correct SQL.
Instructions
START EVERY QUESTION ABOUT THE USER'S DATA HERE.
Including when you are not sure a layer is loaded: if none is, this
answers with `status` instead of failing, so there is no reason to
decide for yourself that there is nothing to query. Deciding that
without calling anything is how a user with a 36-table layer loaded
was told the server had no data.
Returns the part of the layer that bears on this question -- the
tables it selected, their columns, keys, required filters and
metrics, the routing knowledge for choosing between them -- plus
`open_questions`: the claims underneath that nobody has confirmed.
Write your SQL from this, `check_sql` it, then `run_sql`. Put the
open questions under your answer as assumptions.
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": {
"question": "<question>"
},
"name": "context_for_question"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | The user's question in their own words, as plain language and not SQL: 'what was net revenue by region last quarter'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |