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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| country | No | Optional country code for localized results (e.g., US, GB). | US |
Implementation Reference
- src/tools/searchWeb.ts:16-23 (handler)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); },
- src/tools/searchWeb.ts:8-15 (schema)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" })) }; } );