[exa-mcp-server]: Migrate deep research from deprecated v0 to v1 API endpoint#173
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
[exa-mcp-server]: Migrate deep research from deprecated v0 to v1 API endpoint#173devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
…PI endpoint - Update endpoint from /research/v0/tasks to /research/v1 - Update request/response types to match v1 API contract - Use researchId instead of id in responses - Use output.content instead of data.report for completed results - Remove deprecated output.inferSchema from create request - Add .min(1) validation on instructions and taskId to prevent empty strings - Handle new pending/canceled statuses from v1 API Fixes #51 Co-Authored-By: unknown <>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Migrate deep research tools from deprecated v0 to v1 API endpoint
Summary
Fixes #51 — deep research status checks were failing with 400 errors about invalid
inputarguments.The root cause:
deep_researcher_startanddeep_researcher_checkwere calling the deprecated/research/v0/tasksendpoint. The current Exa Research API is at/research/v1, which has a different request/response contract.Changes across 4 files:
config.ts: Endpoint updated from/research/v0/tasks→/research/v1types.ts: Response types updated to match v1 contract (id→researchId,data.report→output.content, newpending/canceledstatuses, flatcostDollarsshape)deepResearchStart.ts: Removed deprecatedoutput.inferSchemafrom request body; usesresearchIdfrom responsedeepResearchCheck.ts: UsesresearchIdandoutput.contentfor completed tasks; handlespendingstatusz.string().min(1)validation oninstructionsandtaskIdto reject empty strings at the MCP layerReview & Testing Checklist for Human
POST https://api.exa.ai/research/v1andGET https://api.exa.ai/research/v1/{researchId}with a real API key to confirm the endpoint works and returnsresearchId(notid)output.contentis the correct path for the research report in completed responses (wasdata.reportin v0)npm run build— the build is a bundler, not a type checker or integration testoutput.inferSchema: falsedoesn't change default behavior — v1 should generate a markdown report when nooutputSchemais providedcanceledstatus handling — currently falls through to the generic "unknown status" branch rather than having explicit handlingNotes
DeepResearchErrorResponsetype (used in the 404 handler) was not updated — it's cast but its fields aren't accessed, so this is low risk but could be cleaned uptimeMsdirectly; it hascreatedAt/finishedAtinstead. ThetimeMsfield was dropped from the completed response returned to MCP clientsLink to Devin run: https://app.devin.ai/sessions/ea76f51f847d40258b7fb6338eebdd6e
Requested by: unknown