UNPKG

clinicaltrialsgov-mcp-server

Version:

Search ClinicalTrials.gov trials, retrieve study details and results, and match patients to eligible trials via MCP. STDIO or Streamable HTTP.

20 lines 1.12 kB
/** * @fileoverview Shared helpers for normalizing tool inputs into API search parameters. * @module mcp-server/tools/definitions/query-helpers */ /** * Normalize `string | string[]` to `string[]`. * * LLM callers intermittently serialize array arguments as JSON strings * (`'["RECRUITING","COMPLETED"]'` rather than `["RECRUITING","COMPLETED"]`). A * `[`-leading string that `JSON.parse`s to an all-string array is unwrapped to * that array. Every legitimate scalar this normalizes (status/phase enums, NCT * IDs, PascalCase field names) starts with a letter, so a `[`-leading string is * always either a stringified array or garbage — and garbage falls through to * the scalar-wrap, preserving the prior behavior. */ export declare function toArray(v: string | string[]): string[]; export declare function toArray(v: string | string[] | undefined): string[] | undefined; /** Build AREA[] phase filter and combine with user's advancedFilter. */ export declare function buildAdvancedFilter(phaseFilter?: string[], advancedFilter?: string): string | undefined; //# sourceMappingURL=query-helpers.d.ts.map