Skip to content

Function: sanitizeResponsesTools()

sanitizeResponsesTools(body): Record<string, unknown>

Strip tool types the upstream model doesn’t support from a Responses request body, returning a shallow copy safe to forward (the input is not mutated).

Clients like the Codex CLI include built-in Responses tools (web_search, local_shell, custom, …) alongside their function tools. Databricks’ Open Responses surface for Anthropic/Claude (and other non-OpenAI providers) only accepts function tools and hard-errors otherwise: “Anthropic does not support tool type ‘web_search’. Only ‘function’ is supported.” Call this before forwarding to /serving-endpoints/open-responses. The OpenAI /serving-endpoints/responses path should keep built-ins (GPT supports them). If filtering empties the list, tools / tool_choice / parallel_tool_calls are dropped so we never send an empty tools: [].

Record<string, unknown>

Record<string, unknown>