Skip to main content
Glama
DaInfernalCoder

MCP-researcher Server

search

Search for straightforward questions and basic information using Perplexity's Sonar Pro model. Provide specific details like error messages, code snippets, and platform information for accurate results.

Instructions

Quick search for simple queries using Perplexity's Sonar Pro model. Best for straightforward questions and basic information lookup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query or question. 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 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.
force_modelNoOptional: Force using this model even if query seems complex

Implementation Reference

  • Handler logic for the 'search' tool: sets the Perplexity model to 'sonar-pro' and constructs a prompt optimized for simple, specific queries.
              case "search": {
                model = "sonar-pro";
                prompt = `You are answering a query that contains specific details like error messages, logs, code snippets, exact terminology, version numbers, and context. Use all provided details to give the most accurate answer possible.
    
    Query: ${query}
    
    Provide a clear, concise answer that directly addresses the specific details in the query.`;
                break;
              }
  • Input schema defining the parameters for the 'search' tool: required 'query' string and optional 'force_model' boolean.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "The search query or question. 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\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."
        },
        force_model: {
          type: "boolean",
          description: "Optional: Force using this model even if query seems complex",
          default: false
        }
      },
      required: ["query"]
    }
  • src/index.ts:264-281 (registration)
    Registration of the 'search' tool in the MCP server's tools list, including name, description, and input schema.
      name: "search",
      description: "Quick search for simple queries using Perplexity's Sonar Pro model. Best for straightforward questions and basic information lookup.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "The search query or question. 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\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."
          },
          force_model: {
            type: "boolean",
            description: "Optional: Force using this model even if query seems complex",
            default: false
          }
        },
        required: ["query"]
      }
    },
  • Helper method that classifies the query complexity and decides whether to use 'search', upgrade to 'reason', or 'deep_research'.
    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";
    }
  • Helper method that detects missing details in technical queries and appends suggestions for better responses in tool outputs.
    private detectMissingDetails(query: string): string[] {
      const queryLower = query.toLowerCase();
      const missingDetails: string[] = [];
    
      // Check for error messages, stack traces, or error-related terms
      const hasErrors = /error|exception|failure|crash|traceback|stack trace|failed/i.test(query) ||
                       /Error:|Exception:|at\s+\w+\.\w+/i.test(query);
      
      // Check for code snippets (common patterns)
      const hasCode = /```|function\s+\w+|const\s+\w+|let\s+\w+|var\s+\w+|import\s+|require\(|\.\w+\(/i.test(query) ||
                      /[a-z]\w*\([^)]*\)/i.test(query) || // function calls
                      /\w+\.\w+\s*=/i.test(query); // property assignments
    
      // Check for version numbers
      const hasVersions = /\d+\.\d+(\.\d+)?/i.test(query) || /version\s*\d+|v\d+/i.test(query);
    
      // Check for specific API/function names (camelCase, PascalCase, or names with dots)
      const hasSpecificNames = /[A-Z][a-z]+[A-Z]|\.\w+\(|::\w+|api\.|sdk\./i.test(query);
    
      // Check for logs or console output
      const hasLogs = /log|console|output|print|trace|debug/i.test(query) && 
                      (query.length > 100 || /\n/.test(query));
    
      // Check for environment/platform details
      const hasEnvironment = /node|python|java|javascript|typescript|react|vue|angular|linux|windows|macos|ubuntu|docker/i.test(queryLower);
    
      // Determine missing details for technical queries
      if (hasErrors && !hasCode && !hasLogs) {
        missingDetails.push("code snippets showing the error context");
        missingDetails.push("relevant logs or stack traces");
      }
      
      if (!hasVersions && (hasCode || hasEnvironment)) {
        missingDetails.push("version numbers (framework, library, runtime versions)");
      }
    
      if (!hasSpecificNames && (hasCode || hasErrors)) {
        missingDetails.push("exact function names, API endpoints, or library names");
      }
    
      if (hasErrors && !hasEnvironment) {
        missingDetails.push("environment details (OS, runtime version, framework)");
      }
    
      // If query seems technical/problem-solving but lacks specifics
      const seemsTechnical = hasErrors || hasCode || /problem|issue|bug|fix|solution|how to|why|debug/i.test(queryLower);
      
      if (seemsTechnical && missingDetails.length === 0) {
        // Still check if it could be more specific
        if (query.length < 50 && !hasCode && !hasErrors) {
          missingDetails.push("specific error messages or code snippets");
          missingDetails.push("exact terminology and context");
        }
      }
    
      return missingDetails;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the model (Sonar Pro) and that it's for 'quick search,' but lacks details on rate limits, authentication needs, response format, or error handling. For a search tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and usage guidelines. Every word earns its place, with no redundancy or fluff. It's appropriately sized for a simple search tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers purpose and usage but lacks behavioral details (e.g., response format, limitations). Without annotations or output schema, the description should do more to compensate, but it's minimally viable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the two parameters. The description doesn't add any parameter-specific information beyond what's in the schema. According to the rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Quick search for simple queries using Perplexity's Sonar Pro model.' It specifies the action (search), the resource (information via Sonar Pro model), and the scope (simple queries, basic information lookup). However, it doesn't explicitly differentiate from its siblings 'deep_research' and 'reason' beyond implying simplicity vs. complexity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Best for straightforward questions and basic information lookup.' This implies when to use it (simple queries) and when not to use it (complex queries, which might be handled by siblings like 'deep_research' or 'reason'). However, it doesn't explicitly name alternatives or state exclusions, keeping it at a 4.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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