brave_web_search
Search the web for general queries, news, articles, and online content to gather broad information from diverse sources with pagination and filtering options.
Instructions
Performs a web search using the Brave Search API, ideal for general queries, news, articles, and online content. Use this for broad information gathering, recent events, or when you need diverse web sources. Supports pagination, content filtering, and freshness controls. Maximum 20 results per request, with offset for pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (max 400 chars, 50 words) | |
| count | No | Number of results (1-20, default 10) | |
| offset | No | Pagination offset (max 9, default 0) |
Implementation Reference
- src/tools/handlers.ts:32-44 (handler)The webSearchHandler function executes the logic for the "brave_web_search" tool by validating its arguments and invoking the performWebSearch utility.
export async function webSearchHandler(args: unknown) { if (!isBraveWebSearchArgs(args)) { throw new Error("Invalid arguments for brave_web_search"); } const { query, count = 10, offset = 0 } = args; const results = await performWebSearch(query, count, offset); return { content: [{ type: "text", text: results }], isError: false, }; }