Skip to main content
Glama

kobold_web_search

Perform web searches using DuckDuckGo to retrieve real-time information, enabling seamless integration with KoboldAI for enhanced text generation and MCP-compatible applications.

Instructions

Search the web via DuckDuckGo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
queryYes

Implementation Reference

  • Core handler logic for all POST-based tools including kobold_web_search: looks up endpoint and schema from dispatch table, validates input, proxies the POST request to the KoboldAI /api/extra/websearch endpoint, and returns the JSON response.
    if (postEndpoints[name]) { const { endpoint, schema } = postEndpoints[name]; const parsed = schema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments: ${parsed.error}`); } const result = await makeRequest(`${apiUrl}${endpoint}`, 'POST', requestData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, };
  • Zod schema defining input for kobold_web_search: optional apiUrl and required query string.
    const WebSearchSchema = BaseConfigSchema.extend({ query: z.string(), });
  • src/index.ts:213-217 (registration)
    Registers kobold_web_search in the list of available tools returned by ListToolsRequest, including name, description, and input schema.
    { name: "kobold_web_search", description: "Search the web via DuckDuckGo", inputSchema: zodToJsonSchema(WebSearchSchema), },
  • Dispatch table mapping for kobold_web_search tool: specifies the KoboldAI API endpoint '/api/extra/websearch' and validation schema.
    kobold_web_search: { endpoint: '/api/extra/websearch', schema: WebSearchSchema },
  • Shared helper function used by all proxy tools, including kobold_web_search, to make HTTP requests to the KoboldAI backend API.
    async function makeRequest(url: string, method = 'GET', body: Record<string, unknown> | null = null) { const options: RequestInit = { method, headers: body ? { 'Content-Type': 'application/json' } : undefined, }; if (body && method !== 'GET') { options.body = JSON.stringify(body); } const response = await fetch(url, options); if (!response.ok) { throw new Error(`KoboldAI API error: ${response.statusText}`); } return response.json(); }

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/PhialsBasement/KoboldCPP-MCP-Server'

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