Skip to main content
Glama

search_web

Search the web for information using structured queries and return organized results. Specify a country code to get localized search results.

Instructions

Search the web for a given query and return structured results (non-AI, parser-based).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
countryNoOptional country code for localized results (e.g., US, GB).US

Implementation Reference

  • The handler function for the 'search_web' tool, which delegates to the getGoogleSearch.handler with the provided query, country, API key, and orbit key.
    handler: async ( { query, country }: { query: string; country?: string }, apiKey: string, orbitKey?: string, ) => { // Reuse the same underlying Google parser-based search return getGoogleSearch.handler({ query, country }, apiKey, orbitKey); },
  • Zod-based input schema for the 'search_web' tool defining 'query' (required string) and 'country' (optional string, default 'US').
    schema: { query: z.string().describe("Search query"), country: z .string() .optional() .default("US") .describe("Optional country code for localized results (e.g., US, GB)."), },
  • src/index.ts:104-116 (registration)
    MCP server registration for the 'search_web' tool using server.tool(), including API key check and response formatting wrapper.
    server.tool( searchWeb.name, searchWeb.description, searchWeb.schema, async (params) => { if (!OLOSTEP_API_KEY) return missingApiKeyError; const result = await searchWeb.handler(params, OLOSTEP_API_KEY, ORBIT_KEY); return { ...result, content: result.content.map(item => ({ ...item, type: item.type as "text" })) }; } );

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/olostep/olostep-mcp-server'

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