Repository navigation
Description
Summary
JCode's OpenAI provider rejects an otherwise valid MCP tool catalog when an MCP tool's inputSchema contains the JSON Schema keyword uniqueItems.
This prevents every agent turn from starting once TubeAlfred's batch tools are advertised. The same tools are accepted and displayed correctly by Claude.
Environment
- JCode:
v0.64.2 (6c6fbba1c) - Provider: OpenAI
- Model:
gpt-5.6-sol - MCP server:
@tubealfred/mcp - Platform: Windows x86_64
Error
invalid_request_error (invalid_function_parameters):
Invalid schema for function 'mcp__tubealfred__youtube_channels_batch':
In context=('properties', 'ids'), 'uniqueItems' is not permitted.
The same failure also applies to youtube_videos_batch, which uses the same ids schema.
Minimal reproducing schema
{
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"maxItems": 50,
"uniqueItems": true
},
"fields": {
"type": ["string", "null"]
}
},
"required": ["ids"]
}uniqueItems is valid JSON Schema 2020-12. MCP uses JSON Schema for tool input schemas, so the MCP server schema itself is valid. Claude accepts the tool and renders ids as the required array parameter.
Suspected cause
openai_compatible_schema in crates/jcode-provider-core/src/openai_schema.rs normalizes constructs such as oneOf and allOf, but leaves uniqueItems intact. JCode then sends it in the OpenAI function parameters schema, whose supported subset rejects the keyword.
Because one unsupported keyword invalidates the complete tool request, this makes JCode unusable while this MCP server is enabled.
Suggested fix
- Strip
uniqueItemsin the OpenAI-specific schema compatibility pass. - Continue relying on the MCP server to enforce uniqueness at execution time.
- Add a regression test using the schema above.
- Consider maintaining an explicit set of OpenAI-unsupported JSON Schema keywords so other valid MCP schemas cannot invalidate the full tool catalog.
A narrower alternative would be to mark such schemas as non-strict, but this should be tested because the endpoint may reject uniqueItems regardless of the strict setting.
Activity
dpc00 commentedon Jul 31, 2026
'This prevents every agent turn from starting once TubeAlfred's batch tools are advertised.' is a mistake. That is only how it looked in TermMate.
Initial concern retracted after direct JCode testing: the failure is not TermMate-specific. A plain
dpc00 commentedon Jul 31, 2026
Test confirms the failure is severe:
the schema.
So “prevents the turn from starting” is essentially accurate, but more precise wording would be:
It does not merely break the TubeAlfred batch call—the batch tool was never invoked. Its presence in
the tool catalog blocks even a plain hello. That is worse and is worth adding as confirmed reproduction
evidence to issue #687.
dpc00 commentedon Jul 31, 2026
JCode’s merge order is a mess:
~/.jcode/mcp.json
↓ overridden by
~/.claude.json
So JCode’s own "enabled": false setting becomes ineffective whenever Claude defines the same server.
The clean next step is to update issue #687 with this second bug: JCode imports Claude’s MCP entry
after its own configuration, preventing a JCode-only opt-out.
1jehuang commentedon Jul 31, 2026
Fixed in
baf0faf59onmaster.The OpenAI compatibility pass now strips JSON Schema keywords that OpenAI's function-parameters subset rejects (
uniqueItems,contains/min|maxContains,unevaluated*,propertyNames,min|maxProperties,dependentSchemas/dependentRequired,if/then/else,not), exactly as you suggested, with your minimal schema as a regression test. The stripping is keyword-aware, so a property literally nameduniqueItemsstill survives. Uniqueness stays enforced by the MCP server at execution time.Thanks for the precise root-cause analysis and the confirmed repro, that made this a one-shot fix. It ships in the next release.
On the second bug you noted (
~/.claude.jsonMCP entries overriding jcode's ownenabled: false): that is a genuinely separate config-precedence bug, so it is better tracked on its own rather than buried here. Happy to file it if you have not already.— Jcode agent (automated triage), on behalf of @1jehuang
fix(openai): strip JSON Schema keywords OpenAI rejects (fixes 1jehuan…
test: verify the #684/#687/#689 fixes through their real integration …
feat(schema): replace per-provider deny-lists with a dialect system
fix(openai): strip unsupported format on the non-strict path too
fix(openai): strip JSON Schema keywords OpenAI rejects (fixes 1jehuan…
8 remaining items
test: verify the 1jehuang#684/1jehuang#687/1jehuang#689 fixes through…
feat(schema): replace per-provider deny-lists with a dialect system
fix(openai): strip unsupported format on the non-strict path too
fix(openai): strip JSON Schema keywords OpenAI rejects (fixes 1jehuan…
test: verify the 1jehuang#684/1jehuang#687/1jehuang#689 fixes through…
feat(schema): replace per-provider deny-lists with a dialect system
fix(openai): strip unsupported format on the non-strict path too
fix(openai): strip JSON Schema keywords OpenAI rejects (fixes 1jehuan…
test: verify the 1jehuang#684/1jehuang#687/1jehuang#689 fixes through…
feat(schema): replace per-provider deny-lists with a dialect system
fix(openai): strip unsupported format on the non-strict path too
feat(schema): replace per-provider deny-lists with a dialect system
fix(openai): strip unsupported format on the non-strict path too
fix(openai): strip JSON Schema keywords OpenAI rejects (fixes 1jehuan…
test: verify the 1jehuang#684/1jehuang#687/1jehuang#689 fixes through…