discard_rejected_schemas(
disclosure: ToolDisclosure,
model: object,
) -> NoneWithhold each disclosed tool whose schema model's provider rejects, failing the whole request.
Anthropic rejects a root oneOf, anyOf or allOf in a tool's input schema,
in tools and inline alike. bind_tools drops such a tool from tools
(bar allOf), but an inline disclosure never passes through it, and
withholding it on every path keeps the disclosure equal to what the model
was shown.