Skip to main content
Glama

brave_search

Search the Brave search engine to find relevant web links for research queries, enabling web data extraction through the LSD MCP Server.

Instructions

Search Brave for possibly relevant links to a query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The inline handler function for the 'brave_search' tool. It takes a query, constructs an LSD scraping script for Brave search results, executes it via runLSD, and formats the extracted links into a text response.
    server.tool("brave_search", "Search Brave for possibly relevant links to a query", { query: z.string() }, async ({ query }) => { const result = await runLSD(`FROM https://search.brave.com?search?q=${encodeURIComponent(query)} |> G ROUP BY div.snippet |> SELECT a@href AS result_link`); return { content: [{ type: 'text', text: `Here are the results for searching on Brave for: ${query}\n\n${JSON.stringify(result)}` }] } })
  • Zod input schema for the brave_search tool, requiring a 'query' string parameter.
    server.tool("brave_search", "Search Brave for possibly relevant links to a query", { query: z.string() }, async ({ query }) => {
  • src/brave.ts:6-18 (registration)
    The applyBraveTool function that registers the brave_search tool, including its description, schema, and handler, onto the MCP server.
    export const applyBraveTool = (server: McpServer) => { server.tool("brave_search", "Search Brave for possibly relevant links to a query", { query: z.string() }, async ({ query }) => { const result = await runLSD(`FROM https://search.brave.com?search?q=${encodeURIComponent(query)} |> G ROUP BY div.snippet |> SELECT a@href AS result_link`); return { content: [{ type: 'text', text: `Here are the results for searching on Brave for: ${query}\n\n${JSON.stringify(result)}` }] } }) }
  • src/index.ts:14-14 (registration)
    During server initialization, applyBraveTool is called to register the brave_search tool.
    applyBraveTool(server);
  • Helper function runLSD used by the brave_search handler to execute LSD (likely 'Liquid Scrape Data') code using the 'internetdata' library's drop.tab() for web scraping.
    export const runLSD = async ( code: string, ): Promise<Array<Record<string, any>>> => { const trip = await drop.tab(); const results = await trip.execute(code); return results; };

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/lsd-so/internetdata-mcp'

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