/** * Detects tool-parameter schemas that pass structural JSON-Schema validation * (so {@link isValidJsonSchema} accepts them) yet make OpenAI-style providers * reject the whole request with HTTP 400 — namely an `enum`/`const` whose * value(s) cannot satisfy the node's declared `type`. MCP servers emit these * when a nullable/array branch is built incorrectly (e.g. a non-null `enum` * copied onto a `type: "null"` branch, or an `enum` placed on an `array` * schema instead of its `items`). One such tool 400s the entire turn, so * callers quarantine just the offending tool. See issue #2652. * * xAI additionally rejects a leftover *root* `anyOf`/`oneOf` whose branches * are not objects ("tool parameter root must be an object type"). That class * is opt-in via {@link FindStrictToolSchemaViolationOptions.rejectRootObjectUnion} * so OpenAI/Azure/Codex keep valid object-root unions. */ export interface FindStrictToolSchemaViolationOptions { /** Reject leftover object-root unions; xAI (paid + OAuth) 400s the whole turn when they remain. */ rejectRootObjectUnion?: boolean; } /** * Walk a tool parameter schema for OpenAI-strict `enum`/`const`-vs-`type` * contradictions. Returns a JSON-pointer-ish path to the first offending node, * or `null` when the schema is safe to emit. */ export declare function findStrictToolSchemaViolation(schema: unknown, path?: string, options?: FindStrictToolSchemaViolationOptions): string | null;