Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYesSearch query (max 400 chars, 50 words)
countNoNumber of results (1-20, default 10)
offsetNoPagination offset (max 9, default 0)

Implementation Reference

  • 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,
      };
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dcostenco/BCBA'

If you have feedback or need assistance with the MCP directory API, please join our Discord server