Suggest a GraphQL or T-SQL query for a question (runs nothing)
answer_query_draftTurns a question in Swedish or English about given tables into T-SQL over the plan's safest join path, and with api into GraphQL in that API's field names, or says why GraphQL cannot answer it. Requires workspace, source, question and tables. Returns JSON with the query, each join step with its rule, and what it assumed. Runs nothing; query_graphql runs the GraphQL version. Errors: {error, kind, hint}.
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": {
"workspace": "<workspace>",
"source": "<source>",
"question": "<question>",
"tables": "<tables>"
},
"name": "answer_query_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api | No | API for GraphQL item over the source; when given, a GraphQL query is drafted too. Default: none (T-SQL only). Example: "shop_api". | |
| keys | No | Primary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}. | |
| schema | No | Schema in the source. Default "dbo". | dbo |
| source | Yes | Lakehouse, warehouse or SQL database, name or id. | |
| tables | Yes | Tables the question is about, exact names. Example: ["orders", "customers"]. | |
| question | Yes | The question, in Swedish or English. Example: "total amount per customer last month". | |
| confirmed | No | Relationships the user confirmed, added to the plan. Default none. Example: [{"source": "orders", "source_cols": ["ship_to_id"], "target": "addresses", "target_cols": ["address_id"]}]. | |
| workspace | Yes | Fabric workspace, name or id. | |
| show_personal_data | No | true includes columns named like personal data; false (default) masks or omits them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |