/** * @fileoverview Shared formatting helpers for tool format() functions and * searchCriteria enrichment trailers. * @module mcp-server/tools/utils/format-helpers */ /** * Flatten CR/LF in upstream text interpolated into a single line, so a line * break in the value cannot start a new `content[]` line and forge structure: * each whitespace run holding a CR or LF becomes one space, and every other * run is kept as is. Runs in time linear in the input. Applied to a value, or * to a whole rendered row whose every part is meant to share one line. * `structuredContent` keeps the value verbatim. */ export declare function oneLine(value: string): string; export declare function oneLine(value: string | undefined): string | undefined; /** * Render study fields not already covered by the primary formatter. * `renderedPrefixes` uses dot-notation paths matching the study structure * (e.g., `"protocolSection.identificationModule.nctId"`). * * Returns indented lines suitable for appending after a study's primary output, * one row per field: a line break in a value folds to a space, unless the leaf * is long-form prose (`PROSE_LEAF`), which keeps its breaks. */ export declare function formatRemainingStudyFields(study: Record, renderedPrefixes: ReadonlySet, { maxLines, maxValueLen }?: { maxLines?: number | undefined; maxValueLen?: number | undefined; }): string[]; /** * A searchCriteria value as Markdown a CommonMark parse reads back as written, * so a `content[]`-only caller can copy it into its next call unchanged. A * string is a code literal: a code span sized past its longest backtick run, * or, when it holds a line break, a fenced block on lines of its own — a code * span cannot hold one, since the block parse ends the line there and reads * the next as a heading, list item, or quote. Each entry of a list renders the * same way, inside `[…]`; a number or boolean renders as itself. */ export declare function formatEchoValue(value: unknown): string; /** * The searchCriteria trailer of `clinicaltrials_search_studies` and * `clinicaltrials_get_study_count`: one `- **key:** value` line per criterion. */ export declare function formatSearchCriteria(criteria: Record): string; //# sourceMappingURL=format-helpers.d.ts.map