Skip to content

[exa-mcp-server]: use highlights: true across all search tools#222

Open
devin-ai-integration[bot] wants to merge 4 commits intomainfrom
devin/1773948041-highlights-instead-of-context
Open

[exa-mcp-server]: use highlights: true across all search tools#222
devin-ai-integration[bot] wants to merge 4 commits intomainfrom
devin/1773948041-highlights-instead-of-context

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 19, 2026

Summary

Switches search tools from requesting full text/context content to highlights: true, which returns focused relevant snippets per search result.

Tools updated:

  • web_search_exa: contents: { text: true, context: { maxCharacters: 10000 } }contents: { highlights: true } (also removed contextMaxCharacters param)
  • company_research_exa: contents: { text: { maxCharacters: 7000 } }contents: { highlights: true }
  • people_search_exa: contents: { text: { maxCharacters: ... } }contents: { highlights: true }
  • linkedin_search_exa: contents: { text: { maxCharacters: ... } }contents: { highlights: true }

Unchanged:

  • crawling_exa — the /contents endpoint does not support highlights: true (returns text regardless), so this tool remains on text: { maxCharacters } with sanitizeContentsResponse
  • web_search_advanced_exa — excluded per request
  • deep_search_exa — already uses highlights with its own config

Updated tools now return a formatted string with Title/URL/Published/Highlights per result (separated by ---) instead of raw JSON.stringify or the server-generated context blob.

Also updates ExaSearchRequest type in types.ts to replace context with highlights.

Updates since last revision

  • Rebased onto main to resolve merge conflicts with the recently-added sanitizeSearchResponse/sanitizeContentsResponse utilities.
  • Removed sanitizeSearchResponse imports from companyResearch, peopleSearch, and linkedInSearch since these tools now return formatted plaintext highlights instead of JSON.stringify(response.data).
  • crawling_exa retains sanitizeContentsResponse since it still returns JSON.

Review & Testing Checklist for Human

  • sanitizeSearchResponse is bypassed for updated tools — the recently-merged sanitizer is no longer called for companyResearch, peopleSearch, and linkedInSearch because they now format results as plaintext. Verify the sanitizer wasn't protecting against anything critical (e.g., stripping sensitive fields from the API response).
  • Response format is a breaking changecompanyResearch, peopleSearch, and linkedInSearch previously returned JSON.stringify(response.data). They now return formatted plaintext (Title:\nURL:\nHighlights:\n...). Any MCP clients parsing JSON from these tools will break.
  • contextMaxCharacters param removed from web_search_exa — existing clients passing this param will get a schema validation error.
  • Test with an actual MCP client (e.g. Claude Desktop) to verify the formatted highlights output is useful and sufficient for LLM consumption. Suggested: invoke each updated tool once and compare output quality to the previous version.

Notes

  • ExaSearchRequest.contents.highlights type supports maxCharacters, numSentences, highlightsPerUrl, and query fields, though only true (boolean) is used by the updated tools.
  • API testing confirmed highlights: true works correctly on /search but NOT on /contents (crawling endpoint).

Link to Devin session: https://app.devin.ai/sessions/828583886cd4479484cf6df638acdd7d

@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 Mar 19, 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 Mar 19, 2026 8:13pm

@devin-ai-integration devin-ai-integration bot changed the title [exa-mcp-server]: use highlights instead of context for web_search_exa [exa-mcp-server]: use highlights: true across all search tools Mar 19, 2026
devin-ai-integration bot and others added 4 commits March 19, 2026 20:10
Switch web_search_exa from requesting context (server-generated LLM string)
to highlights: true, which returns focused relevant snippets per result.

- Replace context param with numSentences/highlightsPerUrl params
- Format response as title/url/highlights per result
- Update ExaSearchRequest type to support highlights

Co-Authored-By: ishan <ishan@exa.ai>
…nces/highlightsPerUrl

Per feedback, use highlights: { maxCharacters: 4000 } which matches
the API pattern better than numSentences/highlightsPerUrl.

Co-Authored-By: ishan <ishan@exa.ai>
Apply highlights: true to all search tools (except webSearchAdvanced
and deepSearch which have their own highlights config):
- webSearch: simplified to highlights: true, removed maxCharacters param
- companyResearch: highlights: true instead of text with maxCharacters
- crawling: highlights: true instead of text with maxCharacters
- peopleSearch: highlights: true instead of text with maxCharacters
- linkedInSearch: highlights: true instead of text with maxCharacters

All tools now format response as title/url/highlights per result.

Co-Authored-By: ishan <ishan@exa.ai>
…ighlights: true

Testing revealed that the /contents endpoint (used by crawling_exa) ignores
highlights: true and returns text instead. Reverted crawling to use
text: { maxCharacters } as before.

Co-Authored-By: ishan <ishan@exa.ai>
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.

0 participants