Skip to content

[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
devin/1770391757-fix-deep-research-v1-endpoint
Open

[exa-mcp-server]: Migrate deep research from deprecated v0 to v1 API endpoint#173
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770391757-fix-deep-research-v1-endpoint

Conversation

@devin-ai-integration
Copy link
Contributor

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 input arguments.

The root cause: deep_researcher_start and deep_researcher_check were calling the deprecated /research/v0/tasks endpoint. 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/v1
  • types.ts: Response types updated to match v1 contract (idresearchId, data.reportoutput.content, new pending/canceled statuses, flat costDollars shape)
  • deepResearchStart.ts: Removed deprecated output.inferSchema from request body; uses researchId from response
  • deepResearchCheck.ts: Uses researchId and output.content for completed tasks; handles pending status
  • Added z.string().min(1) validation on instructions and taskId to reject empty strings at the MCP layer

Review & Testing Checklist for Human

  • Verify the v1 endpoint is live: Call POST https://api.exa.ai/research/v1 and GET https://api.exa.ai/research/v1/{researchId} with a real API key to confirm the endpoint works and returns researchId (not id)
  • Verify output.content is the correct path for the research report in completed responses (was data.report in v0)
  • Test the full deep research flow end-to-end: Start a research task, poll for completion, confirm the report is returned correctly. This PR was only verified via npm run build — the build is a bundler, not a type checker or integration test
  • Confirm removing output.inferSchema: false doesn't change default behavior — v1 should generate a markdown report when no outputSchema is provided
  • Check canceled status handling — currently falls through to the generic "unknown status" branch rather than having explicit handling

Notes

  • The DeepResearchErrorResponse type (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 up
  • The v1 response no longer has timeMs directly; it has createdAt/finishedAt instead. The timeMs field was dropped from the completed response returned to MCP clients
  • Types were derived from inspecting the Kronos v1 controller DTOs in the monorepo, not from live API testing

Link to Devin run: https://app.devin.ai/sessions/ea76f51f847d40258b7fb6338eebdd6e
Requested by: unknown

…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 <>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
exa-mcp-server Ready Ready Preview, Comment Feb 6, 2026 3:32pm

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.

Invalid JSON response during deep research status check tool call

0 participants