Skip to main content
Glama

brave_search

Search Brave for relevant links by entering a query, enabling quick access to web data through the LSD MCP Server integration.

Instructions

Search Brave for possibly relevant links to a query

Input Schema

NameRequiredDescriptionDefault
queryYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "query": { "type": "string" } }, "required": [ "query" ], "type": "object" }

Implementation Reference

  • src/brave.ts:6-18 (registration)
    Registers the 'brave_search' tool on the MCP server, including input schema { query: z.string() } and the handler function.
    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)}` }] } }) }
  • The handler function for brave_search that scrapes Brave search using LSD and returns formatted results.
    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)}` }] } })
  • Helper function runLSD used by brave_search handler to execute LSD scraping code.
    export const runLSD = async ( code: string, ): Promise<Array<Record<string, any>>> => { const trip = await drop.tab(); const results = await trip.execute(code); return results; };
  • src/index.ts:14-14 (registration)
    Top-level call to register the brave_search tool by invoking applyBraveTool on the MCP server.
    applyBraveTool(server);

Other Tools

Related 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