@coopah/bentley-tool-web-search
v0.3.0
Published
Web search tool for Bentley agents
Downloads
265
Readme
@coopah/bentley-tool-web-search
Web search tool for Bentley agents. Lets agents search the web via DuckDuckGo — completely free, no API key required. Returns structured results (title, URL, snippet).
Install
pnpm add @coopah/bentley-tool-web-searchDependencies
@coopah/bentley-coreduck-duck-scrape— DuckDuckGo search (no API key)ai^6.0.116zod^4.3.6
Usage
import { createBentley } from "@coopah/bentley-core";
import { bentleyWebSearchPlugin } from "@coopah/bentley-tool-web-search";
const bentley = createBentley({
plugins: [
bentleyWebSearchPlugin(), // no config needed
],
});Once registered, agents with access to this tool can call it to search the web. The tool accepts a query string and returns an array of { title, url, snippet }.
API
bentleyWebSearchPlugin(config?)—BentleyPluginthat registers the web search toolcreateWebSearchTool(config?)— Low-level Vercel AI tool factory
Configuration
interface WebSearchConfig {
maxResults?: number; // defaults to 5
}Tool Schema
// Input
{ query: string }
// Output
Array<{ title: string; url: string; snippet: string }>Related Packages
| Package | Role |
|---------|------|
| @coopah/bentley-core | Core runtime (required) |
| @coopah/bentley-tool-browser | Browser automation tool |
| @coopah/bentley-tool-exec | Shell execution tool |
License
MIT
