create_recipe
Save a named, parameterized DataFusion SQL query to the organization's recipe catalog; run_recipe runs it with arguments. Check the SQL with run_sql first. The output aliases are the contract callers read.
PARAMETERS are bound as typed values, never pasted into the SQL.
SLOTS are parts a caller may swap: a grain (the date_trunc unit), a dimension (the grouping column) or an optional_filter (a droppable WHERE conjunct). Widen an existing recipe with a slot rather than create a near-duplicate. This is ENFORCED: if a recipe already reads every table and column yours needs, the create is REFUSED, naming it. If a new recipe really is right, repeat the call with acknowledge_similar naming those ids.
The response names joins no declared TableLink vouches for and combinations worse than the defaults: relay those to the user.
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": "create_recipe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One read-only statement over ids, as `run_sql` takes them. Every output column aliased. Parameters are `$name` (never `:name` or `$1`), each declared in `params`. | |
| name | Yes | Short, specific name: what a colleague scans the catalog for. | |
| slots | No | Slots, a JSON array of `grain`, `dimension` or `optional_filter` entries. A dimension's column, and every column it may be replaced by, must appear nowhere else in the recipe (WHERE, HAVING, another output column, a join condition), or it is refused. Allowed columns may come from any table the recipe reads. | |
| params | No | Parameters, a JSON array of `{"name": "country", "kind": "String", "required": true}`. Values here are TAGGED (`{"t": "str", "v": "DE"}`, `{"t": "i64", "v": 10}`, `{"t": "bool", "v": true}`): an optional parameter takes `"default": {"t": "str", "v": "DE"}`, a restricted one `"choices": {"source": "literal", "values": [{"t": "str", "v": "DE"}]}`. `run_recipe` arguments are NOT tagged. | |
| description | No | What the recipe computes, and any caveat a reader would need. | |
| acknowledge_similar | No | Recipe ids named in a `similar_recipe_exists` refusal, to create anyway. |