/** * @fileoverview Run read-only SQL SELECT queries against water data tables staged on a DataCanvas * by water_get_series or water_find_sites. Requires CANVAS_PROVIDER_TYPE=duckdb. * @module mcp-server/tools/definitions/water-dataframe-query.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const waterDataframeQuery: import("@cyanheads/mcp-ts-core").ToolDefinition, z.ZodObject<{ rows: z.ZodArray>; row_count: z.ZodNumber; truncated: z.ZodBoolean; }, z.core.$strip>, readonly [{ readonly reason: "canvas_disabled"; readonly code: JsonRpcErrorCode.InvalidRequest; readonly when: "DataCanvas is not enabled on this server instance."; readonly recovery: "DataCanvas is not available on this server instance; read the data directly instead — water_get_series returns the most recent records inline, and water_find_sites pages its matches with limit/offset."; }, { readonly reason: "canvas_not_found"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "The canvas_id does not exist or has expired."; readonly recovery: "Re-run the tool that staged the data — water_get_series or water_find_sites — to stage it again and get a fresh canvas_id."; readonly thrownBy: "service"; }, { readonly reason: "table_not_found"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "The SQL names a table that is not staged on this canvas — it may have expired, or was never created."; readonly recovery: "Call water_dataframe_describe with this canvas_id to list the staged tables, or re-run water_get_series or water_find_sites to stage the data again."; }, { readonly reason: "system_catalog_access"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The SQL reads a database system catalog (information_schema, pg_catalog, sqlite_master, duckdb_*) instead of a staged table."; readonly recovery: "Query the staged tables directly — call water_dataframe_describe with this canvas_id for their names and columns."; }, { readonly reason: "invalid_sql"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The SQL is not a read-only SELECT, contains disallowed functions, is syntactically invalid, or failed on the staged data (a cast or conversion the engine could not apply)."; readonly recovery: "Use only SELECT statements. Do not use file-reading functions (read_csv, read_parquet, etc.). When the message names a value the engine could not convert, wrap the cast in TRY_CAST or filter those rows out first."; }], undefined>; //# sourceMappingURL=water-dataframe-query.tool.d.ts.map