You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI_APICallError: tools.19.custom.input_schema: JSON schema is invalid. #2082
I've upgraded to version 0.5.7 and I'm currently getting the following error with Sonnet 4 and GPT 5 ( I haven't tested any other models yet)
AI_APICallError: tools.19.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-
schema.org/draft/2020-12). Learn more about tool use at https://docs.anthropic.com/en/docs/tool-use.
The common thread appears to be JSON schema validation failures when using GPT-5/Sonnet 4 models with OpenCode's tool system. These issues suggest the tool schemas being sent to these models may not be compatible with their JSON Schema draft 2020-12 requirements.
Feel free to ignore if none of these address your specific case.
Yeah idk if there is anything to do on our end, it may make sense to sanitize mcp tools in some cases but if the entire schema isn't valid for your provider that sounds kinda painful for us to solve for...
Yep I agree with that. I wouldn't think developers would expect that either.
Maybe it would be useful to have more detail in the error message? I'm fine to debug which MCP server is causing the issue in my config. But maybe if the AI_APICallError could return some info about the tool that caused the error, and if it was an MCP server, which MCP it was?
hm that part is harder because that error is coming from the provider, we dont know which one they disnt like unless they tell us, this is provider specific
Ahh ok yea if tricky to do, then probably ok to leave.
Good to be aware of it.
The experience for me is that when I saw the error, I wasn’t sure if it was
an MCP causing it, or some other tool call. Which made it difficult to
understand what was going on.
Happy to close though if there are higher priorities
Tony
Activity
github-actions commentedon Aug 19, 2025
This issue might be a duplicate of existing issues. Please check:
'low' is not supported with the 'gpt-5-chat-latest' model#1984: GPT-5 model parameter compatibility issues with specific model configurationsThe common thread appears to be JSON schema validation failures when using GPT-5/Sonnet 4 models with OpenCode's tool system. These issues suggest the tool schemas being sent to these models may not be compatible with their JSON Schema draft 2020-12 requirements.
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Aug 19, 2025
@adeperio what mcp servers are you using? This looks like an mcp server
adeperio commentedon Aug 20, 2025
Hi @rekram1-node here are my MCPs (sitting at the global level)
I'll try isolate the MCP and report back
adeperio commentedon Aug 20, 2025
Hi @rekram1-node
It's the browser-use MCP causing issues.
rekram1-node commentedon Aug 20, 2025
Yeah idk if there is anything to do on our end, it may make sense to sanitize mcp tools in some cases but if the entire schema isn't valid for your provider that sounds kinda painful for us to solve for...
What do you think?
adeperio commentedon Aug 20, 2025
Yep I agree with that. I wouldn't think developers would expect that either.
Maybe it would be useful to have more detail in the error message? I'm fine to debug which MCP server is causing the issue in my config. But maybe if the AI_APICallError could return some info about the tool that caused the error, and if it was an MCP server, which MCP it was?
rekram1-node commentedon Aug 20, 2025
hm that part is harder because that error is coming from the provider, we dont know which one they disnt like unless they tell us, this is provider specific
rekram1-node commentedon Aug 20, 2025
ppl in claude code reporting similar thing w/ different mcp: anthropics/claude-code#586
adeperio commentedon Aug 20, 2025
rekram1-node commentedon Aug 20, 2025
yeah we could try to parse response out for every provider and show a better err message but idk seems like more work to keep up with
rekram1-node commentedon Aug 20, 2025
i think it is best we close this for now and will readdress better later if needed
adeperio commentedon Aug 21, 2025
Thanks @rekram1-node yep for sure. Thanks for your comments!