You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b9dbc21
Browse filesBrowse the repository at this point in the historyBrowse files
feat(mcp): chain dependent sql_execute batch steps with {{label.column}} and {{label}}
Dependent queries cost a model round trip each. In a `queries` batch a later step can now use an earlier step's rows: `{{label.column}}` becomes a literal value list (SQL `(...)`, MongoDB JSON array; quoted, at most 1,000 source rows) and `{{label}}` a scratch table holding them (stored as `result_N`, steps on warehouse `scratch`). A referenced step fetches up to 1,000 rows. A reference to a failed, missing, oversized or non-scratch step fails only that step; the rest still run. Substituted SQL goes through the usual read-only checks. Descriptions +132 chars.
Tests: `server.test.ts` (ALTIMATE_MCP_E2E=1): same-connection chain, cross-connection list + scratch join, over-cap list, mid-batch error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
warehouse_add: "Add a connection when warehouse_list shows none or the one you need is missing.",
27
27
schema_inspect: "List tables when table is omitted; otherwise one table's columns and value profile.",
28
28
sql_execute:
29
-
"Run SQL and return rows. Put independent queries in one call with `queries`; `tables` describes tables in the same call. Source writes need --allow-write.",
29
+
"Run SQL and return rows. Chain queries in one call with `queries`: a later one can use {{label.column}} (value list from an earlier result) or {{label}} (its rows as a scratch table, warehouse scratch). `tables` describes tables first. Source writes need --allow-write.",
30
30
sql_check: "Read-only data check: fanout, keys, grain, nulls or coverage.",
31
31
sql_materialize: "Store a read-only query's rows as a scratch table, to join across connections.",
.max(MAX_BATCH_QUERIES,`queries accepts at most ${MAX_BATCH_QUERIES} items`)
76
83
.nullish()
77
84
.describe(
78
-
`Up to ${MAX_BATCH_QUERIES}independent read-only queries run in one call, each returning its own labeled result; one failing query does not stop the others. Use instead of query when no query depends on another's result.`,
85
+
`Up to ${MAX_BATCH_QUERIES} read-only queries run in order in one call, each returning its own labeled result; one failing query does not stop the others. A later query can use an earlier one's rows: {{label.column}} becomes a literal value list (at most ${MAX_BOUND_ROWS} rows) and {{label}} a scratch table (warehouse scratch).`,
"Execute SQL against a connected data warehouse. Returns all selected columns as a formatted table. full_text_columns prioritizes named cells within the ordinary output budget and always saves returned rows to result_path; read with char_offset/max_chars recovers clipped text. [] or null, or omitting the field, turns the mode off. A non-empty list caps preview rows at 20: omit limit to use the default; larger limits clamp to 20 with a result note. Missing column names produce a bounded note listing available columns while still returning rows. "+
125
132
"Provide exactly one of query, query_from or queries. query_from runs a read-only generator SELECT and executes its single SQL string result (up to 1 MiB) as a read-only SELECT on warehouse, without previewing or retyping the generated SQL. "+
126
-
`queries runs up to ${MAX_BATCH_QUERIES}independent read-only queries in one call and returns one labeled result per query; batch queries that do not depend on each other. `+
133
+
`queries runs up to ${MAX_BATCH_QUERIES} read-only queries in order in one call and returns one labeled result per query; a later query can reference an earlier one with {{label.column}} (value list) or {{label}} (scratch table). `+
127
134
"For DuckDB table sets, generate query_table([...], true) with escaped table-name string literals. For thousands of tables, UNION ALL BY NAME batches of at most 128 names to stay within the default expression depth.",
0 commit comments