store_result
Materialise a SELECT into a private scratch table you can re-query and JOIN in later execute_sql calls — without re-piping rows through the conversation. Use it as a scratchpad for multi-step analysis: pull a slice once, store it, then derive several things from it. Call start_question first and pass its question_id — the scratchpad is scoped to your question. Also pass a short name (lowercase letters/digits/underscores, e.g. gen_by_region) and the sql (a single read-only SELECT/WITH over consolidated.* / semantic.*, or over your own earlier scratch tables). The result lives in the scratch database; the returned qualified_name is what you reference later — e.g. SELECT ... FROM <qualified_name> JOIN consolidated.x ... (remember to pass the same question_id on that execute_sql call). Returns the schema, row count, a few sample rows (the full data stays in ClickHouse), and time_window — the range the stored rows actually cover. Check that window against the window your question is about: the table name records the measure, not the period, so a too-tight WHERE here is invisible later. Re-storing the same name overwrites it. Tables are private to your question, capped in count and size, and expire automatically. Prefer this over re-running a big query whenever you need an intermediate result in more than one later step.
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": {
"name": "<name>",
"sql": "<sql>"
},
"name": "store_result"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SELECT/WITH to materialise. May read `consolidated.*`, `semantic.*`, or your own earlier scratch tables. The rows are stored in ClickHouse, not returned through the conversation. | |
| name | Yes | Short handle for the scratch table — lowercase letters, digits, and underscores only, starting with a letter (e.g. `gen_by_region`). Re-using a name overwrites that table. | |
| question_id | No | **Required.** The UUID from a `start_question` call — the scratchpad is scoped to it. Call `start_question` first if you don't have one. |