Add Exa MCP server + fix tool schema validation for Google AI Studio models#32
Add Exa MCP server + fix tool schema validation for Google AI Studio models#32
Conversation
Agent-Logs-Url: https://github.com/chinkan/RustFox/sessions/aeaa3f4f-e531-4666-8850-659cb03375e3 Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
…patibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
Add test_sanitize_schema_recurses_into_items to verify that sanitize_schema properly recurses into array items schemas and removes undefined required fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/chinkan/RustFox/sessions/2bc3f06f-5196-4db0-bf6b-02fe9f104458 Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
|
@copilot exa should be under browse and web category |
Agent-Logs-Url: https://github.com/chinkan/RustFox/sessions/12c690b5-0660-49dd-981b-53ba224315b4 Co-authored-by: chinkan <16433287+chinkan@users.noreply.github.com>
Done — moved |
|
Claude finished @chinkan's task in 1m 37s —— View job Code Review: PR #32 — Add Exa MCP server + fix tool schema validation for Google AI Studio modelsTasks:
Overall AssessmentThis is a clean, well-structured PR. The core schema sanitization fix is correct and the implementation is solid. The Exa integration follows established patterns. A few gaps worth noting before merging.
|
| Area | Status |
|---|---|
| Schema sanitization logic | ✅ Correct |
required / properties filtering |
✅ Correct |
Recursion: nested properties |
✅ Covered |
Recursion: items |
✅ Covered |
Recursion: additionalProperties |
|
| Logging when schema mutated | |
| Test coverage | ✅ Comprehensive |
| Exa catalog entry | ✅ Correct category |
config.example.toml |
✅ Clear and consistent |
The PR is mergeable as-is — the core fix addresses the stated problem correctly. The additionalProperties recursion and logging suggestions are improvements worth considering, either here or as follow-up issues.
There was a problem hiding this comment.
Pull request overview
Adds compatibility handling for strict tool-schema validation (notably Google AI Studio Gemini/Gemma via OpenRouter) and introduces Exa as a selectable remote MCP server in the setup wizard.
Changes:
- Sanitize tool parameter JSON Schemas before sending OpenRouter requests by filtering invalid
requiredentries and recursing into nested schemas. - Add Exa (
https://mcp.exa.ai/mcpvianpx mcp-remote) to the setup wizard MCP catalog and document it inconfig.example.toml. - Add an implementation plan document for the Exa + schema fix work.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/llm.rs |
Adds sanitize_schema() and applies it to tool schemas before API calls; adds unit tests for sanitizer behavior. |
setup/index.html |
Adds Exa entry to MCP_CATALOG for setup wizard configuration generation. |
config.example.toml |
Adds a commented Exa [[mcp_servers]] example block with EXA_API_KEY. |
docs/superpowers/plans/2026-04-08-exa-mcp-and-gemma-schema-fix.md |
Adds an internal implementation plan (currently inconsistent with the shipped Exa catalog entry). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| In `setup/index.html`, locate the line containing `{ name:'threads', ...}` (around line 509). | ||
| Insert the following new entry **immediately before** the `threads` line so it sits in the `'Knowledge & Data'` group alongside `tavily` and `context7`: | ||
|
|
||
| ```javascript | ||
| { name:'exa', category:'Knowledge & Data', desc:'Neural web & document search (remote)', runner:'npx', args:['-y','mcp-remote','https://mcp.exa.ai/mcp','--header','x-api-key:${EXA_API_KEY}'], envVars:['EXA_API_KEY'], link:'https://exa.ai/mcp' }, |
There was a problem hiding this comment.
This plan instructs adding exa under the Knowledge & Data category and shows args including --header x-api-key:${EXA_API_KEY}, but the actual implementation in setup/index.html adds exa under Browser & Web with args ['-y','mcp-remote','https://mcp.exa.ai/mcp']. Please update the plan to match the shipped catalog entry (category, insertion location, and args/auth approach) so future readers don’t follow incorrect instructions.
| Expected: | ||
| ``` | ||
| PASS: exa found | ||
| PASS: category=Knowledge & Data |
There was a problem hiding this comment.
The verification snippet’s expected output hardcodes PASS: category=Knowledge & Data, which will fail with the current setup/index.html change (the Exa entry is categorized as Browser & Web). Adjust the expected output (and/or the regex) to reflect the implemented category so the plan remains self-consistent.
| PASS: category=Knowledge & Data | |
| PASS: category=Browser & Web |
Google AI Studio (Gemini/Gemma via OpenRouter) rejects tool schemas where
requiredlists property names absent fromproperties. Many MCP servers ship schemas with this violation, making these models unusable when any such tool is loaded.Schema sanitization (
src/llm.rs)Added
sanitize_schema()— a recursiveserde_json::Valuemutator applied to every tool definition inchat_with_model()before the API call:required[]to only retain keys that exist inpropertiesrequiredentirely if the filtered array is emptypropertiesanditemsschemasExa MCP server
setup/index.html: AddedexatoMCP_CATALOGunderBrowser & Web— bridgeshttps://mcp.exa.ai/mcpvianpx mcp-remote, requiresEXA_API_KEYconfig.example.toml: Added commented[[mcp_servers]]example block for Exa