Skip to main content
Glama

deep_research

Conducts in-depth analysis and generates detailed research reports on complex topics using advanced AI models for comprehensive investigation.

Instructions

Conducts in-depth analysis and generates detailed reports using Perplexity's Sonar Deep Research model. Best for comprehensive research topics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe research topic or question to investigate in depth. IMPORTANT: Be extremely specific and include all relevant details: - Include exact error messages, logs, and stack traces if applicable - Provide exact terminology, function names, API names, version numbers - Include relevant code snippets showing the problem or context - Specify platform, OS, framework versions, and environment details - Mention any attempted solutions or workarounds - Provide context about what you're trying to achieve - Include relevant data structures, configurations, or inputs - Specify the scope, constraints, or specific requirements The more specific details you include, the more accurate and helpful the answer will be. If you don't have enough specific information, prompt the user to provide it before using this tool.
focus_areasNoOptional: Specific aspects or areas to focus on
force_modelNoOptional: Force using this model even if query seems simple

Implementation Reference

  • Executes the deep_research tool by selecting the 'sonar-deep-research' model, extracting optional focus_areas, and constructing a comprehensive research prompt tailored to the query and details provided.
    case "deep_research": { model = "sonar-deep-research"; const { focus_areas = [] } = request.params.arguments as { focus_areas?: string[] }; prompt = `You are answering a research query that contains specific details like error messages, logs, code snippets, exact terminology, version numbers, and context. Use all provided details to conduct the most accurate and comprehensive research. Research Query: ${query}`; if (focus_areas.length > 0) { prompt += `\n\nFocus areas:\n${focus_areas.map((area, i) => `${i + 1}. ${area}`).join('\n')}`; } prompt += `\n\nProvide a detailed analysis that: 1. Incorporates and addresses all specific details provided (errors, logs, code, versions, configurations, etc.) 2. Provides background and context relevant to the specific scenario described 3. Defines key concepts and terminology matching the exact terms used 4. Presents the current state of knowledge relevant to the specific problem or topic 5. Explores different perspectives applicable to the described situation 6. Covers recent developments that relate to the specific details provided 7. Discusses practical applications relevant to the exact context 8. Identifies challenges and limitations specific to the scenario 9. Suggests future directions or solutions based on the specific details 10. Includes expert opinions and references to sources that address the specific issue 11. Tailors all recommendations to the exact technical context, versions, and environment described`; break;
  • Input schema for the deep_research tool, defining a required 'query' string parameter with detailed description, optional 'focus_areas' array of strings, and optional 'force_model' boolean.
    inputSchema: { type: "object", properties: { query: { type: "string", description: "The research topic or question to investigate in depth. IMPORTANT: Be extremely specific and include all relevant details:\n- Include exact error messages, logs, and stack traces if applicable\n- Provide exact terminology, function names, API names, version numbers\n- Include relevant code snippets showing the problem or context\n- Specify platform, OS, framework versions, and environment details\n- Mention any attempted solutions or workarounds\n- Provide context about what you're trying to achieve\n- Include relevant data structures, configurations, or inputs\n- Specify the scope, constraints, or specific requirements\n\nThe more specific details you include, the more accurate and helpful the answer will be.\nIf you don't have enough specific information, prompt the user to provide it before using this tool." }, focus_areas: { type: "array", items: { type: "string" }, description: "Optional: Specific aspects or areas to focus on" }, force_model: { type: "boolean", description: "Optional: Force using this model even if query seems simple", default: false } }, required: ["query"] }
  • src/index.ts:301-326 (registration)
    Registers the deep_research tool in the MCP ListTools response, providing name, description, and input schema.
    { name: "deep_research", description: "Conducts in-depth analysis and generates detailed reports using Perplexity's Sonar Deep Research model. Best for comprehensive research topics.", inputSchema: { type: "object", properties: { query: { type: "string", description: "The research topic or question to investigate in depth. IMPORTANT: Be extremely specific and include all relevant details:\n- Include exact error messages, logs, and stack traces if applicable\n- Provide exact terminology, function names, API names, version numbers\n- Include relevant code snippets showing the problem or context\n- Specify platform, OS, framework versions, and environment details\n- Mention any attempted solutions or workarounds\n- Provide context about what you're trying to achieve\n- Include relevant data structures, configurations, or inputs\n- Specify the scope, constraints, or specific requirements\n\nThe more specific details you include, the more accurate and helpful the answer will be.\nIf you don't have enough specific information, prompt the user to provide it before using this tool." }, focus_areas: { type: "array", items: { type: "string" }, description: "Optional: Specific aspects or areas to focus on" }, force_model: { type: "boolean", description: "Optional: Force using this model even if query seems simple", default: false } }, required: ["query"] } }
  • Helper method that classifies query complexity as 'research' based on keywords, enabling automatic selection of the deep_research tool when a 'search' tool call matches research patterns.
    private determineQueryComplexity(query: string): "simple" | "complex" | "research" { // Check for research indicators const researchIndicators = [ "analyze", "research", "investigate", "study", "examine", "explore", "comprehensive", "detailed", "in-depth", "thorough", "compare and contrast", "evaluate", "assess" ]; // Check for complex reasoning indicators const complexIndicators = [ "how", "why", "what if", "explain", "solve", "steps to", "difference between", "compare", "which is better", "pros and cons", "advantages", "disadvantages" ]; const query_lower = query.toLowerCase(); // Check for research patterns if (researchIndicators.some(indicator => query_lower.includes(indicator))) { return "research"; } // Check for complex patterns if (complexIndicators.some(indicator => query_lower.includes(indicator))) { return "complex"; } // Default to simple if no complex/research patterns found return "simple"; }

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/DaInfernalCoder/perplexity-mcp'

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