Skip to main content
Glama
arjunkmrm

Perplexity Deep Research MCP

deep_research

Conduct detailed web searches with contextually relevant results and citations using Perplexity's Deep Research API, filtering by recency as needed.

Instructions

Perform a comprehensive web search using Perplexity's Deep Research API, which provides detailed and contextually relevant results with citations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query to perform
search_recency_filterNoFilter search results by recency (options: month, week, day, hour)

Implementation Reference

  • Handler for executing the 'deep_research' tool. Sends the query to Perplexity's sonar-deep-research model via API, includes optional recency filter, returns formatted content and citations or error.
    case "deep_research": {
      const { 
        query, 
        search_recency_filter
      } = request.params.arguments as {
        query: string;
        search_recency_filter?: string;
      };
    
      try {
        const payload: any = {
          model: "sonar-deep-research",
          messages: [
            {
              role: "user",
              content: query
            }
          ],
          max_tokens: this.maxTokens,
          temperature: this.temperature
        };
    
        // Add optional parameters if provided
        if (search_recency_filter) {
          payload.search_recency_filter = search_recency_filter;
        }
    
        console.error(`Using model: sonar-deep-research, max_tokens: ${this.maxTokens}, temperature: ${this.temperature}`);
    
        const response = await axios.post('https://api.perplexity.ai/chat/completions', payload, {
          headers: {
            'Authorization': `Bearer ${process.env.PERPLEXITY_API_KEY!}`,
            'Content-Type': 'application/json'
          }
        });
        
        // Format the response to only include content and citations
        const formattedResponse = {
          content: response.data.choices[0].message.content,
          citations: response.data.citations || []
        };
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(formattedResponse, null, 2)
          }]
        };
      } catch (error: unknown) {
        if (axios.isAxiosError(error)) {
          const axiosError = error as AxiosError<PerplexityErrorResponse>;
          const errorData = axiosError.response?.data;
          const errorMessage = errorData?.error || errorData?.message || axiosError.message;
          
          return {
            content: [{
              type: "text", 
              text: `Perplexity API error: ${errorMessage}`
            }],
            isError: true
          };
        }
        throw error;
      }
    }
  • src/index.ts:55-77 (registration)
    Registers the 'deep_research' tool in the ListToolsRequestHandler, providing name, description, and input schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [{
          name: "deep_research",
          description: "Perform a comprehensive web search using Perplexity's Deep Research API, which provides detailed and contextually relevant results with citations.",
          inputSchema: {
            type: "object",
            properties: {
              query: {
                type: "string",
                description: "The search query to perform"
              },
              search_recency_filter: {
                type: "string",
                description: "Filter search results by recency (options: month, week, day, hour)",
                enum: ["month", "week", "day", "hour"]
              }
            },
            required: ["query"]
          }
        }]
      };
    });
  • Input schema definition for the 'deep_research' tool: requires 'query' string, optional 'search_recency_filter' enum.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "The search query to perform"
        },
        search_recency_filter: {
          type: "string",
          description: "Filter search results by recency (options: month, week, day, hour)",
          enum: ["month", "week", "day", "hour"]
        }
      },
      required: ["query"]
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool provides 'detailed and contextually relevant results with citations,' which hints at output behavior, but lacks critical details like rate limits, authentication requirements, error handling, or whether it's a read-only operation. For a web search tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that directly states the tool's function and key features without unnecessary words. It is appropriately sized and front-loaded with the core purpose.

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 moderate complexity (web search with two parameters) and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on output format, error cases, or behavioral constraints. With no annotations and incomplete behavioral transparency, it meets the minimum viable threshold but has clear gaps.

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?

The input schema has 100% description coverage, clearly documenting both parameters. The description does not add any meaning beyond what the schema provides—it doesn't explain parameter interactions, default behaviors, or usage examples. Baseline 3 is appropriate when the schema does all the work.

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 performs a 'comprehensive web search' using a specific API (Perplexity's Deep Research API), which is a specific verb+resource combination. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, so it cannot achieve a perfect score of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or specific contexts. It mentions the API provides 'detailed and contextually relevant results with citations,' but this is a feature description rather than usage guidance.

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

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/arjunkmrm/perplexity-deep-research'

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