exa.ai

Command Palette

Search for a command to run...

How Coding Agents Use Web Search to Vet an Unfamiliar Package

Last updated: 11/5/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

How Coding Agents Use Web Search to Vet an Unfamiliar Package

Teams give coding agents a web search API so the agent can read a package's documentation, issue trackers, and changelogs before recommending an install. Exa's Search API is built for this: it returns clean page content from docs sites, GitHub, and registries, so the agent can judge whether a package is maintained, breaking, or abandoned before it touches your lockfile.

Introduction

When a coding agent needs a library it has never seen, its training data is the wrong source of truth. Models trained months ago cannot know that a package was deprecated last week, that its latest major release changed the API, or that its issue tracker is full of unresolved security reports. The fix is to give the agent web tools: a search endpoint to find the right pages, and a way to read them as clean text.

This article explains what those tools look like in practice, which signals an agent should collect before adding a dependency, and how Exa's Search API (with the Contents API for full-page retrieval) covers the workflow.

Key Takeaways

  • Vetting an unfamiliar package means checking four things: current documentation, recent changelog or release activity, open issue trends, and whether the docs match the version you would install.
  • Exa's Search API finds and reads these sources in one call, returning page text and highlights instead of raw HTML, which keeps the agent's context window focused on signal.
  • The auto search type (about 1 second typical latency, $7 per 1,000 requests) is the default for this job; lite (about 450 ms, $4 per 1,000) suits high-volume checks where cached content is fine.
  • The Contents API fetches a known URL, such as a specific changelog page, at $1 per 1,000 URLs per content type.
  • Exa exposes its tools over MCP, so agents in MCP-compatible clients can search and read the web without custom glue code.

What "vetting a package" actually requires

A careful pre-install check gathers evidence from four kinds of pages:

  1. Official documentation. Does the package do what the task needs? Is the documented API the current one?
  2. Changelog and release history. When did the package last ship? Are there breaking changes between the version the agent knows and the latest?
  3. Issue tracker. Are open issues mostly minor, or are there unresolved crashes, security reports, and "is this maintained?" threads?
  4. Migration and deprecation notices. Has the project moved, renamed, or been replaced?

Each of these lives on a different site with a different layout: a docs portal, a GitHub releases page, a GitHub issues list, a README. A general-purpose search API has to find all of them and return them in a form an agent can read cheaply.

How Exa's Search API covers the workflow

Exa's Search API is a single /search endpoint (see the Search quickstart) that searches the web and returns cleaned page content. For code and documentation specifically, Exa built a dedicated ingestion pipeline for code search (described in its WebCode post), and its open-sourced WebCode evaluations score how well extracted content preserves prose, code blocks, API signatures, and tables from technical pages.

A typical vetting request looks like this:

curl -X POST https://api.exa.ai/search \
  -H "Authorization: Bearer $EXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "left-pad npm package changelog latest release",
    "type": "auto",
    "numResults": 5,
    "contents": { "highlights": true }
  }'

The response includes each result's URL, title, page text or highlights, and (when available) an estimated publishedDate, which helps the agent tell a 2024 blog post from last month's release notes. Highlights return only the passages that match the query, which matters when an agent is pulling release notes and issue threads into a limited context window.

Choosing a search type is a latency-versus-depth decision. auto takes about 1 second and costs $7 per 1,000 requests; lite returns in about 450 ms at $4 per 1,000 requests but serves cached content only and does not support AI page summaries. For a vetting step that runs once per proposed dependency, auto is the sensible default; lite fits high-volume sweeps. Both include 10 results in the base price, with results above 10 at $1 per 1,000.

Reading the pages: Contents API

Search finds the pages; the Contents API reads them. Given a known URL, such as a changelog page or a specific GitHub issue, it returns clean text, highlights, or an AI summary at $1 per 1,000 URLs per requested content type. It handles JavaScript-rendered pages, PDFs, and complex layouts. It does not bypass paywalls, logins, or CAPTCHAs, so private issue trackers stay private.

The subpages parameter follows up to N linked subpages from a URL (0 to 100) and may return fewer, which is useful for pulling pages linked from a docs index in one request. subpageTarget prioritizes which sections to fetch.

Wiring it into the agent

Two integration paths are common:

  • Direct API calls. The agent's tool schema exposes a search_package_docs function that calls the Search API and returns highlights. This gives you full control over parameters like includeDomains (for example, restricting a query to github.com and the project's docs domain).
  • MCP. Exa provides an MCP server, so MCP-compatible coding agents (Claude Code, Cursor, and similar clients) can search and read the web as built-in tools with no custom HTTP layer.

Either way, the pattern is the same: the agent proposes a package, the tool layer fetches evidence, and the agent cites that evidence (or declines the dependency) before editing any manifest file.

What the agent should do with the evidence

Search and retrieval only set up the decision. A useful vetting prompt asks the agent to report, with citations to the pages it read:

  • the latest published version and its release date,
  • any breaking changes between the version it would install and the version its training data knows,
  • the tone of recent issues (bug reports versus feature requests, maintainer responsiveness),
  • whether the documented install command and API match the current release.

Requiring citations keeps the check auditable. A teammate can click through to the changelog entry or issue thread the agent relied on, which turns "the model said it was fine" into a reviewable claim.

Frequently Asked Questions

Can a coding agent do this without web access? It can guess from training data, but it cannot know about releases, deprecations, or security issues published after its training cutoff. Web search is what makes the check current.

Why not just fetch the GitHub page directly? You can, for known URLs, and the Contents API is the right tool for that. Search is needed when the agent does not know where the docs, changelog, or canonical repo live, or when it needs to scan several sources at once.

How much does this cost per vetting check? A single check with auto search at the base price is $0.007 for up to 10 results, and page text and highlights on /search are included in that price. A team vetting 50 packages a day (1,500 over a 30-day month) would spend roughly $10.50 on search alone at base pricing.

Does Exa work with MCP-based coding agents? Yes. Exa publishes an MCP server that exposes its search and content tools to MCP-compatible clients, so agents can use them as native tools.

Conclusion

Vetting an unfamiliar package is a research task, and coding agents do research well when they have the right web tools. Exa's Search API finds the documentation, changelogs, and issue threads that matter and returns them as clean, quotable text; the Contents API reads specific pages on demand; and MCP support makes both available in the agents teams already use. Give your agent the tools to check before it installs: explore the Search API and Exa's documentation to get started.

Related Articles