Skip to main content
Glama

search

Search the web using Brave Search API to retrieve structured results including titles, URLs, and descriptions without scraping pages directly.

Instructions

Search the web using Brave Search API — fast, reliable, no rate limits. Returns titles, URLs, and descriptions as structured JSON without scraping the pages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesThe search query
countNoNumber of results (1-20, default 5)
contextNoOptional: what you're trying to accomplish. Helps with result relevance.

Implementation Reference

  • The registration and handler implementation for the "search" tool in the mcp-server. It calls a remote API endpoint and formats the response.
    server.tool(
      "search",
      "Search Google and return structured results (title, URL, snippet). Does not scrape the pages.",
      {
        query: z.string().describe("Search query"),
        maxResults: z
          .number()
          .int()
          .min(1)
          .max(20)
          .optional()
          .describe("Max results to return (default: 5, max: 20)"),
      },
      async ({ query, maxResults }) => {
        const data = await callApi("/search", { query, maxResults });
        const results = data.results || [];
        const formatted = results
          .map((r, i) => `${i + 1}. **${r.title}**\n   ${r.url}\n   ${r.snippet}`)
          .join("\n\n");
        return {
          content: [
            {
              type: "text" as const,
              text: formatted || "No results found.",
            },
          ],
        };
      }
    );
Install Server

Other Tools

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/kc23go/anybrowse'

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