Skip to main content
Glama
Cam10001110101

mcp-server-ollama-deep-researcher

configure

Set research parameters including loop count, AI model selection, and search API configuration for in-depth topic investigation.

Instructions

Configure the research parameters (max loops, LLM model, search API)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxLoopsNoMaximum number of research loops (1-10)
llmModelNoOllama model to use (e.g. llama3.2)
searchApiNoSearch API to use for web research

Implementation Reference

  • The handler function for the 'configure' tool. It processes input arguments to update the global research configuration (maxLoops, llmModel, searchApi) with validation, or returns the current configuration if no arguments provided.
    case "configure": { const newConfig = request.params.arguments; let configMessage = ''; if (newConfig && Object.keys(newConfig).length > 0) { try { // Validate new configuration if (newConfig.maxLoops !== undefined) { if (typeof newConfig.maxLoops !== 'number' || newConfig.maxLoops < 1 || newConfig.maxLoops > 10) { throw new Error("maxLoops must be a number between 1 and 10"); } } if (newConfig.searchApi !== undefined) { if (newConfig.searchApi !== 'perplexity' && newConfig.searchApi !== 'tavily' && newConfig.searchApi !== 'exa') { throw new Error("searchApi must be 'perplexity', 'tavily', or 'exa'"); } // Validate API key for new search API validateApiKeys(newConfig.searchApi); } // Type guard to ensure properties match ResearchConfig const validatedConfig: Partial<ResearchConfig> = {}; if (typeof newConfig.maxLoops === 'number') { validatedConfig.maxLoops = newConfig.maxLoops; } if (typeof newConfig.llmModel === 'string') { validatedConfig.llmModel = newConfig.llmModel; } if (newConfig.searchApi === 'perplexity' || newConfig.searchApi === 'tavily' || newConfig.searchApi === 'exa') { validatedConfig.searchApi = newConfig.searchApi; } config = { ...config, ...validatedConfig }; configMessage = 'Research configuration updated:'; } catch (error) { return { content: [ { type: "text", text: `Configuration error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } else { configMessage = 'Current research configuration:'; } return { content: [ { type: "text", text: `${configMessage} Max Loops: ${config.maxLoops} LLM Model: ${config.llmModel} Search API: ${config.searchApi}`, }, ], }; }
  • src/index.ts:129-150 (registration)
    The tool registration in the ListTools handler, defining the name, description, and input schema for the 'configure' tool. This makes the tool available to MCP clients.
    name: "configure", description: "Configure the research parameters (max loops, LLM model, search API)", inputSchema: { type: "object", properties: { maxLoops: { type: "number", description: "Maximum number of research loops (1-10)" }, llmModel: { type: "string", description: "Ollama model to use (e.g. llama3.2)" }, searchApi: { type: "string", enum: ["perplexity", "tavily", "exa"], description: "Search API to use for web research" } }, required: [], }, },
  • The input schema defining the parameters for configuring research: maxLoops (number), llmModel (string), searchApi (enum). No required fields, allowing partial updates.
    inputSchema: { type: "object", properties: { maxLoops: { type: "number", description: "Maximum number of research loops (1-10)" }, llmModel: { type: "string", description: "Ollama model to use (e.g. llama3.2)" }, searchApi: { type: "string", enum: ["perplexity", "tavily", "exa"], description: "Search API to use for web research" } }, required: [], },
  • Helper function validateApiKeys used in the configure handler to ensure the required API key is set for the selected searchApi.
    function validateApiKeys(searchApi: string): void { if (searchApi === "tavily" && !process.env.TAVILY_API_KEY) { throw new Error("TAVILY_API_KEY is required when using Tavily search API"); } if (searchApi === "perplexity" && !process.env.PERPLEXITY_API_KEY) { throw new Error("PERPLEXITY_API_KEY is required when using Perplexity search API"); } if (searchApi === "exa" && !process.env.EXA_API_KEY) { throw new Error("EXA_API_KEY is required when using Exa search API"); } }
  • Type definition for the ResearchConfig interface used to type the global config state and validate tool inputs.
    interface ResearchConfig { maxLoops: number; llmModel: string; searchApi: "perplexity" | "tavily" | "exa"; }

Other 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/Cam10001110101/mcp-server-ollama-deep-researcher'

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