Skip to content

sanitizeGeminiToolSchema

sanitizeGeminiToolSchema<T>(schema): T

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/providers/geminiSchemaSanitizer.ts:294

Pure, recursive normaliser: returns a cleaned DEEP COPY of a JSON-Schema containing only keywords Gemini’s function-declaration Schema accepts, so its OpenAPI-3.0 subset accepts the tool. At each node the SAFE composition keywords are first RESOLVED into supported equivalents (resolveComposition: constenum, clean allOf → shallow merge) and only then does the allowlist drop the rest. Does not mutate the input. anyOf unions survive; $ref/oneOf/not are dropped (see resolveComposition for why the last three are deferred, not resolved).

T = unknown

T

T