Skip to main content
Glama

smart_search

Search the web, retrieve news, and conduct research using query-based inputs, with optional custom instructions and conversation continuity for tailored results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conversationIdNoA hex UUID to maintain conversation continuity (optional)
instructionsNoCustom instructions for tailoring the response (optional)
queryYesThe query to send to You.com's Smart API

Implementation Reference

  • src/index.ts:53-80 (registration)
    MCP server registration for the 'smart_search' tool, including Zod input schema, error-handling wrapper, and delegation to YouApiClient.smartSearch
    server.tool( "smart_search", { query: z.string().describe("The query to send to You.com's Smart API"), instructions: z.string().optional().describe("Custom instructions for tailoring the response (optional)"), conversationId: z.string().optional().describe("A hex UUID to maintain conversation continuity (optional)") }, async ({ query, instructions, conversationId }: { query: string; instructions?: string; conversationId?: string }) => { try { const result = await youClient.smartSearch(query, instructions, conversationId); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { console.error("Smart search error:", error); return { content: [{ type: "text", text: `Error performing smart search: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • Core handler function in YouApiClient that performs the actual HTTP request to You.com's '/smart' API endpoint for AI-powered search
    async smartSearch( query: string, instructions?: string, conversationId?: string ): Promise<SmartResult> { try { const params: Record<string, string> = { query: query }; if (instructions) { params.instructions = instructions; } if (conversationId) { params.conversation_id = conversationId; } const response = await this.chatClient.get('/smart', { params }); return response.data; } catch (error) { console.error('Error in You.com smart API call:', error); throw error; } }
  • TypeScript interface defining the expected output structure of the smartSearch API response
    interface SmartResult { answer: string; results: Array<{ url: string; title: string; snippet: string; }>; }
  • Zod schema defining the input parameters for the smart_search MCP tool
    query: z.string().describe("The query to send to You.com's Smart API"), instructions: z.string().optional().describe("Custom instructions for tailoring the response (optional)"), conversationId: z.string().optional().describe("A hex UUID to maintain conversation continuity (optional)") },

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/jimbul/youdotcom_MCP'

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