fix(mcp): remove oneOf from browser_click schema that breaks Claude API clients#4212
Open
gabros20 wants to merge 1 commit intobrowser-use:mainfrom
Open
fix(mcp): remove oneOf from browser_click schema that breaks Claude API clients#4212gabros20 wants to merge 1 commit intobrowser-use:mainfrom
gabros20 wants to merge 1 commit intobrowser-use:mainfrom
Conversation
… clients The browser_click tool used oneOf at the top level of inputSchema to express the index-vs-coordinates constraint. Claude's API (and other strict JSON Schema validators) reject oneOf/allOf/anyOf at the top level of a tool input schema with a 400 error, which cascades and breaks all MCP tools registered in the same session. The _click() handler already validates at runtime and returns a clear error string when neither index nor coordinates are provided, so the oneOf constraint was redundant. Move the constraint into the property descriptions instead. Fixes browser-use#4211
Author
|
The |
Author
|
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #4211
browser_clickin the MCP server usesoneOfat the top level ofinputSchemato express "provide eitherindexORcoordinate_x+coordinate_y":{ "type": "object", "properties": { ... }, "oneOf": [ {"required": ["index"]}, {"required": ["coordinate_x", "coordinate_y"]} ] }Claude's API (and other strict MCP clients) rejects
oneOf/allOf/anyOfat the top level of a tool input schema:This cascades — it breaks all MCP tools in the session, not just
browser_click.Fix
Remove the
oneOfblock. The constraint is now expressed in the property descriptions instead. No behaviour change: the runtime guard in_click()already returns a clear error string when neitherindexnor coordinates are provided.Diff summary
-4 lines: remove theoneOf: [...]block entirely+3 lines: update the three property descriptions to say "Provide this OR ..."The
_click()handler is untouched.Summary by cubic
Remove the top-level oneOf from the browser_click tool schema to stop Claude and other strict MCP clients from rejecting the tool and breaking the session. No behavior change; validation stays in _click(), and field descriptions now explain using index or coordinate_x+coordinate_y.
Written for commit 217b451. Summary will update on new commits.