feat: add OPENCLAUDE_DISABLE_STRICT_TOOLS env var to opt out of strict MCP tool schema normalization (#770)
When set, disables strict schema normalization for non-Gemini providers. Useful for OpenAI-compatible endpoints that reject MCP tools with complex optional params (e.g. list[dict]) with "Extra required key ... supplied" errors.
This commit is contained in:
@@ -607,7 +607,10 @@ function convertTools(
|
|||||||
function: {
|
function: {
|
||||||
name: t.name,
|
name: t.name,
|
||||||
description: t.description ?? '',
|
description: t.description ?? '',
|
||||||
parameters: normalizeSchemaForOpenAI(schema, !isGemini),
|
parameters: normalizeSchemaForOpenAI(
|
||||||
|
schema,
|
||||||
|
!isGemini && !isEnvTruthy(process.env.OPENCLAUDE_DISABLE_STRICT_TOOLS),
|
||||||
|
),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1657,7 +1660,7 @@ class OpenAIShimMessages {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
throwClassifiedTransportError(error, responsesUrl)
|
throwClassifiedTransportError(error, responsesUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responsesResponse.ok) {
|
if (responsesResponse.ok) {
|
||||||
return responsesResponse
|
return responsesResponse
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user