open-meteo-mcp-server
Version:
Model Context Protocol server for Open-Meteo weather APIs
20 lines • 999 B
TypeScript
export declare const CHARACTER_LIMIT = 25000;
/**
* Truncates large tool responses so they stay within CHARACTER_LIMIT.
*
* Weather responses hold parallel time-series arrays under `hourly`/`daily`/
* `minutely_15` (one entry per timestamp across several variables); shrinking
* them all by the same ratio keeps the series internally consistent. List
* responses (e.g. geocoding's `results`) are truncated directly.
*
* Returns the original value unchanged if it's already within the limit, or
* if it has no recognized shape to truncate (nothing is guessed at).
*/
export declare function truncateResponse(result: unknown): unknown;
/**
* Serializes a tool result exactly as it is sent to the client, truncating it
* first when needed. Single source of truth for the response text, so the size
* that truncation measures can never drift from the size actually emitted.
*/
export declare function serializeToolResponse(result: unknown): string;
//# sourceMappingURL=truncation.d.ts.map