Skip to content

fix(mcp): standardize parameter schemas for Google Gemini compatibility - #263

Open
pcgeek86 wants to merge 1 commit into
Skyvern-AI:mainfrom
pcgeek86:fix/mcp-schema-gemini-compatibility
Open

pcgeek86 wants to merge 1 commit into
Skyvern-AI:mainfrom
pcgeek86:fix/mcp-schema-gemini-compatibility

Conversation

@pcgeek86

Copy link
Copy Markdown

Summary

Fixes #262

When using rustwright-mcp with Google Gemini models via Vertex AI (such as in OpenCode via @ai-sdk/google-vertex), Vertex AI enforces strict validation on OpenAPI 3.03 / JSON Schema tool definitions.

Specifically:

  • browser_file_upload.paths previously defined "type": ["array", "null"]. When translated to Gemini's schema format, type: ["array", "null"], it became an anyOf union with items remaining as a sibling field.
  • Vertex AI strictly enforces: "When using any_of, it must be the only field set." Having items alongside any_of caused Vertex AI to reject requests with HTTP 400 (Unable to submit request because rustwright_browser_file_upload functionDeclaration parameters.paths schema specified other fields alongside any_of).
  • Similarly, browser_network_request.part defined "type": ["string", "null"].
  • browser_drag (startElement, endElement), browser_console_messages (filename), browser_network_requests (filter, filename), and browser_handle_dialog (promptText) also used "type": ["string", "null"].

Changes

  1. Standardize optional parameter schemas in mcp/src/tools.rs to single types ("type": "array", "type": "string") omitted from "required", aligning with upstream Playwright MCP standards (@modelcontextprotocol/server-playwright).
  2. Remove null from browser_network_request.part's enum list.
  3. Update unit tests and e2e schema assertions in mcp/src/tools.rs and mcp/tests/stdio_e2e.rs.
  4. Update serialized catalog fixtures (mcp/tests/fixtures/tools-list.json, tools-list-lean.json, tools-list-legacy.json) and SHA-256 fixture checksum in mcp/tests/fixtures/README.md.

Verification

  • cargo check --locked
  • cargo check --manifest-path mcp/Cargo.toml --locked
  • cargo test --manifest-path mcp/Cargo.toml --bin rustwright-mcp (all 43 tests pass, including catalog fixture match)
  • cargo test --lib (all 397 unit tests pass)

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.

[Bug]: Rustwright-MCP function calls not accepted by OpenCode + Google Gemini provider

1 participant