/** * Gemini function-calling schema sanitizer. * * Normalises an MCP tool's JSON Schema into the subset Gemini's function-calling * accepts. `@google/genai`'s processJsonSchema crashes on untyped nodes, * `$ref`/`$defs`, and some `anyOf`/`oneOf` shapes, so we rebuild a clean tree: * every node gets a concrete `type`, unions collapse to their first concrete * branch, and unsupported keywords are dropped. * * Pure, dependency-free, and assertion-free — values arrive as `unknown` and are * narrowed with the `isRecord` guard. Safe to reuse for any Gemini tool path. */ /** * Rebuild a JSON Schema node into the Gemini-safe subset. Returns a fresh object * with a concrete `type` on every node. */ export declare function sanitizeSchema(node: unknown): Record; /** Tool parameters must be an object schema; force it and sanitize the tree. */ export declare function sanitizeToolParameters(schema: unknown): Record; /** * Walk a (sanitized) schema and return the first node the google plugin would * turn into `undefined` — which genai then crashes on. Returns a human-readable * path/reason, or `null` if the schema is safe. After `sanitizeSchema` this * should always be `null`; if not, it names the exact offending path. */ export declare function findSchemaIssue(node: unknown, pathPrefix?: string): string | null;