@dex-ai/web-tools
v0.1.2
Published
Web fetch and search tools for Dex agents — fetch URLs as clean markdown, search the web, and render JS pages with Playwright.
Readme
@dex-ai/web-tools
Web fetch and search tools for Dex agents.
Tools
| Tool | Description |
|------|-------------|
| web_fetch | Fetch any URL and return its content as clean markdown/text/JSON. Uses Readability + turndown for HTML→markdown. |
| web_search | Search the web. Default: DuckDuckGo HTML search (no API key). Configurable backend. |
| web_snapshot | (optional) Render a page with Playwright headless browser for JS-rendered content. |
Usage
import { createWebToolsExtension } from "@dex-ai/web-tools";
const agent = await Agent.create({
extensions: [
createWebToolsExtension({
// optional config
timeout: 15_000,
cacheTTL: 300_000,
rateLimitPerDomain: 10,
}),
// ... other extensions
],
});Configuration
| Option | Default | Description |
|--------|---------|-------------|
| timeout | 15_000 | Request timeout in ms |
| maxResponseSize | 1_048_576 | Max response body (bytes) |
| cacheTTL | 300_000 | Cache TTL in ms (5 min) |
| rateLimitPerDomain | 10 | Max requests per domain per window |
| rateLimitWindow | 60_000 | Rate limit window in ms |
| searchEndpoint | DuckDuckGo | Custom search URL |
| searchApiKey | — | API key for custom search |
| allowedDomains | [] | Allowlist (empty = all allowed) |
| blockedDomains | [] | Blocklist |
| respectRobotsTxt | true | Check robots.txt before fetching |
Sub-path Exports
@dex-ai/web-tools— core:web_fetch+web_search@dex-ai/web-tools/with-snapshot— addsweb_snapshot(requires Playwright install)
