Web Tools

Web tools let the agent search the internet and fetch web page content. This is useful when the agent needs to look up documentation, check API references, or find solutions to specific errors.

WebSearch

The websearch tool performs internet searches using Exa, a search engine optimized for developer content. It returns a list of relevant results with titles, URLs, and snippets that the agent can review to find the information it needs.

ParameterTypeDescription
querystringThe search query. Works best with specific, technical queries.
num_resultsnumber (optional)Number of results to return. Default: 5.

How the Agent Uses Search

The agent does not search the web randomly. It searches when it encounters a problem it cannot solve from its training data or your codebase alone. Common triggers include unfamiliar library APIs, obscure error messages, and recently released features that may be newer than its training cutoff.

# The agent might search for:
websearch query="zod v3.24 discriminatedUnion type inference"
websearch query="Next.js 16 app router middleware redirect loop"
websearch query="prisma client 6.0 breaking changes migration guide"

After receiving search results, the agent typically selects the most relevant result and uses webfetch to read the full page content.

WebFetch

The webfetch tool retrieves the content of a web page and returns it as readable text. HTML is converted to a clean text format, stripping navigation, ads, and other non-content elements so the agent can focus on the information it needs.

ParameterTypeDescription
urlstringThe URL of the page to fetch.

What It Can Fetch

  • Documentation pages (MDN, React docs, library READMEs).
  • GitHub issues and pull requests.
  • Stack Overflow answers.
  • Blog posts and tutorials.
  • API documentation and specifications.
  • Package registry pages (npm, PyPI, crates.io).
# Fetch documentation for a specific API
webfetch url="https://zod.dev/docs/discriminatedUnion"

# Read a GitHub issue for context
webfetch url="https://github.com/prisma/prisma/issues/12345"

# Check an npm package README
webfetch url="https://www.npmjs.com/package/@tanstack/react-query"

Note

The webfetch tool extracts the main content from pages and strips boilerplate HTML. The result is plain text optimized for the agent to read, not a full HTML document.

Use Cases

Looking Up Documentation

When the agent needs to use a library API it is not fully confident about, it searches for the official documentation and reads the relevant page. This ensures the code it writes uses current, correct APIs.

# Your prompt:
Add server-side pagination to the products table using
@tanstack/react-table v8.

# The agent might:
# 1. Search for "@tanstack/react-table v8 server-side pagination"
# 2. Fetch the relevant docs page
# 3. Read the current table component
# 4. Implement pagination following the official docs

Debugging Unfamiliar Errors

When the agent encounters an error it does not immediately recognize, it can search for the error message to find known solutions and workarounds.

Checking API References

When integrating with external APIs (Stripe, Twilio, AWS, etc.), the agent can fetch the API documentation to ensure it is using the correct endpoints, parameters, and authentication methods.

Staying Current

The agent's training data has a cutoff date. For libraries and frameworks with recent releases, web tools bridge the gap by fetching the latest documentation and migration guides.

Permissions & Limits

Web tools have specific permission and usage considerations.

AspectDefaultNotes
websearch permissionaskYou approve each search query before it executes.
webfetch permissionaskYou approve each URL fetch before it executes.
Network accessRequiredWeb tools do not work in fully offline mode or when network access is blocked by sandbox.
Content sizeTruncatedVery large pages are truncated to fit within context limits. The agent sees the first portion.
JavaScript renderingNoWebfetch retrieves the initial HTML. Single-page applications that require JavaScript to render content may return incomplete results.

Tip

If you want the agent to search freely without prompting for each query, set websearch and webfetch to "allow" in your creor.json permissions.

Disabling Web Tools

If your project should not access the internet (e.g., air-gapped environments, compliance requirements), you can deny web tools entirely.

1
2
3
4
5
6
{
"permissions": {
"websearch": "deny",
"webfetch": "deny"
}
}