/** * @fileoverview `brapi_dataframe_query` — execute SQL across in-memory * dataframes. Dataframes auto-populate when find_* tools spill (each becomes * `df_`). SQL is the primary paging idiom — use `LIMIT/OFFSET` to walk * a large dataframe, projection (`SELECT col1, col2`) to trim rows, and * aggregation (`COUNT`, `GROUP BY`, `AVG`) to summarize without materializing * every row in the LLM context. Use `registerAs` to materialize a result as * a new dataframe — the response carries a bounded `preview` slice plus the * full `rowCount`. Read-only enforcement is the framework's three-layer SQL * gate (single statement → SELECT only → plan-walk allowlist). * * Every query runs under a `registerAs` so DuckDB's describe is the * authoritative type source for the response columns. When the caller * doesn't supply `registerAs`, the handler generates an internal * `_brapi_probe_` name, describes the materialized table for types, * then drops it before returning — so types stay consistent with what * `brapi_dataframe_describe` would report. * * Defaults to a fresh per-tenant default workspace; the agent never passes a * canvasId. The bridge resolves it via `ctx.state` so multiple calls in the * same session reuse the same workspace. * * @module mcp-server/tools/definitions/brapi-dataframe-query.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const brapiDataframeQuery: import("@cyanheads/mcp-ts-core").ToolDefinition; preview: z.ZodOptional; rowLimit: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ rowCount: z.ZodNumber; columns: z.ZodArray>; rows: z.ZodArray>; dataframe: z.ZodOptional; }, z.core.$strip>, readonly [{ readonly reason: "sql_rejected"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "SQL violated read-only rules (multi-statement, non-SELECT, or disallowed operation)"; readonly recovery: "Submit a single SELECT statement using only registered dataframes. For changes, use `registerAs` in this tool to materialize a result, or brapi_dataframe_drop to remove a dataframe."; }], undefined>; //# sourceMappingURL=brapi-dataframe-query.tool.d.ts.map