Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(mcp): remove oneOf from browser_click schema that breaks Claude API clients#4212

Open
gabros20 wants to merge 1 commit intobrowser-use:mainfrom
gabros20:fix/mcp-browser-click-oneof-schema
Open

fix(mcp): remove oneOf from browser_click schema that breaks Claude API clients#4212
gabros20 wants to merge 1 commit intobrowser-use:mainfrom
gabros20:fix/mcp-browser-click-oneof-schema

Conversation

@gabros20
Copy link

@gabros20 gabros20 commented Feb 25, 2026

Problem

Closes #4211

browser_click in the MCP server uses oneOf at the top level of inputSchema to express "provide either index OR coordinate_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/anyOf at the top level of a tool input schema:

400 tools.N.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level

This cascades — it breaks all MCP tools in the session, not just browser_click.

Fix

Remove the oneOf block. 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 neither index nor coordinates are provided.

Diff summary

  • -4 lines: remove the oneOf: [...] 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.

… 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
@CLAassistant
Copy link

CLAassistant commented Feb 25, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@gabros20
Copy link
Author

The type-checker failure is pre-existing on main (run #22411858393) — identical 36 errors in skill_cli/ and skills/, all related to browser_use_sdk types that aren't available for pyright. Our diff only touches browser_use/mcp/server.py (4 lines removed, 3 description strings updated).

@gabros20
Copy link
Author

The pre-commit failure is also pre-existing on main — the only failing hook is pyright (same 36 browser_use_sdk errors as above). All other hooks passed cleanly on our change:

ruff check    ✅ Passed
ruff format   ✅ Passed
codespell     ✅ Passed
pyupgrade     ✅ Passed
pyright       ❌ Failed  ← pre-existing, unrelated to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server: browser_click schema uses oneOf which breaks Claude Code / Claude API clients

2 participants