/** * @fileoverview `brapi_build_phenotype_matrix` — pull observations across one or * more studies and pivot them into a germplasm × trait matrix materialized as a * canvas dataframe. Returns a dataframe handle plus a summary of dimensions, * aggregate method, and any warnings encountered during the pull. * * The per-study observation pull (with its `/observations` → `/observationunits` * fallback chain) lives in `../shared/observations.ts`, shared with * `brapi_germplasm_performance`. * * Column safety: wide-matrix column names are SQL-safe identifiers derived from * `observationVariableDbId` via `../shared/canvas-columns.ts` — BrAPI DbIds are * routinely numeric (Breedbase) or collide with reserved SQL words, both of * which the canvas identifier gate rejects. A `variableLegend` mapping safe * column → display name is returned so callers can resolve columns back. * * @module mcp-server/tools/definitions/brapi-build-phenotype-matrix.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const brapiBuildPhenotypeMatrix: import("@cyanheads/mcp-ts-core").ToolDefinition; studies: z.ZodArray; variables: z.ZodOptional>; germplasm: z.ZodOptional>; shape: z.ZodDefault>; aggregate: z.ZodDefault>; loadLimit: z.ZodOptional; extraFilters: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ alias: z.ZodString; studies: z.ZodArray; shape: z.ZodEnum<{ wide: "wide"; long: "long"; }>; aggregate: z.ZodEnum<{ all: "all"; mean: "mean"; median: "median"; first: "first"; }>; observationCount: z.ZodNumber; germplasmCount: z.ZodNumber; variableCount: z.ZodNumber; variableLegend: z.ZodRecord; dataframe: z.ZodOptional; columnLegend: z.ZodOptional>; createdAt: z.ZodString; expiresAt: z.ZodString; truncated: z.ZodOptional; maxRows: z.ZodOptional; totalCount: z.ZodOptional; }, z.core.$strip>>; warnings: z.ZodArray; }, z.core.$strip>, readonly [{ readonly reason: "unknown_alias"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "No connection has been registered under the requested alias"; readonly recovery: "Run brapi_connect with this alias (or omit `alias` to use the default connection) before calling brapi_build_phenotype_matrix."; }, { readonly reason: "all_filters_dropped"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The active dialect dropped every filter supplied — the call would silently widen to the unfiltered baseline"; readonly recovery: "Drop unsupported filters or use studies / germplasm / variables to scope the query to supported filter paths on the active dialect."; }, { readonly reason: "no_observation_path"; readonly code: JsonRpcErrorCode.ServiceUnavailable; readonly when: "Neither /observations nor /observationunits returned data for any requested study after probing both paths"; readonly recovery: "Verify the studyDbIds exist and the BrAPI server exposes /observations or /observationunits. Use brapi_server_info to inspect the capability list."; }], undefined>; //# sourceMappingURL=brapi-build-phenotype-matrix.tool.d.ts.map