/** * @fileoverview `brapi_dataframe_export` — write a dataframe to disk in a * researcher-friendly format (CSV, Parquet, JSON) and return the absolute * path. Hands off the file to the human; the agent doesn't read it back. * * Stdio-only and gated behind `BRAPI_EXPORT_DIR` — the entry point bridges * `BRAPI_EXPORT_DIR` → the framework's `CANVAS_EXPORT_PATH` so the canvas * provider's path-traversal sandbox stays in charge of resolution. Under * `MCP_TRANSPORT_TYPE=http` or with `BRAPI_EXPORT_DIR` unset, the tool is * omitted from `tools/list` entirely (operators see the gate reason on * `/.well-known/mcp.json`). * * Optional `columns` (thin projection) or `sql` (full SELECT) materialize a * temporary canvas table first, export it, then drop it. The dataframe input * always identifies the *source* dataframe — that's the name the paired-drop * cleanup keys off of when `brapi_dataframe_drop` later removes it. * * @module mcp-server/tools/definitions/brapi-dataframe-export.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const brapiDataframeExport: import("@cyanheads/mcp-ts-core").ToolDefinition; filename: z.ZodOptional; columns: z.ZodOptional>; sql: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ dataframe: z.ZodString; format: z.ZodEnum<{ csv: "csv"; parquet: "parquet"; json: "json"; }>; path: z.ZodString; filename: z.ZodString; sizeBytes: z.ZodNumber; rowCount: z.ZodNumber; columns: z.ZodArray>; expiresAt: z.ZodString; }, z.core.$strip>, readonly [{ readonly reason: "export_dir_unset"; readonly code: JsonRpcErrorCode.ConfigurationError; readonly when: "BRAPI_EXPORT_DIR is not configured (defensive — the registration gate normally hides the tool when this happens)"; readonly recovery: "Set BRAPI_EXPORT_DIR on the server before retrying."; }, { readonly reason: "dataframe_not_found"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "No dataframe with this name exists on the canvas (expired, dropped, or typo)"; readonly recovery: "Call brapi_dataframe_describe to list available dataframes."; }, { readonly reason: "invalid_filename"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "filename contains path separators or traversal segments"; readonly recovery: "Provide a filename without \"/\", \"\\\", or \"..\" — leave it unset to use the default."; }, { readonly reason: "mutually_exclusive_projection"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "Both `columns` and `sql` were supplied"; readonly recovery: "Pass either `columns` for a thin projection or `sql` for filtering/aggregation, not both."; }], undefined>; //# sourceMappingURL=brapi-dataframe-export.tool.d.ts.map