Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/perplexityai/modelcontextprotocol/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The perplexity_search tool performs direct web searches using the Perplexity Search API. Unlike AI-powered tools, it returns raw search results without synthesis, making it perfect for discovering URLs, verifying facts, and finding recent information.
This tool returns raw search results (titles, URLs, snippets, dates) without AI interpretation. For AI-generated answers with citations, use perplexity_ask instead.

Use Cases

  • Finding specific URLs or websites
  • Checking recent news and events
  • Verifying facts across multiple sources
  • Discovering available sources on a topic
  • Getting publication dates for content

Parameters

query
string
required
The search query string to execute.Example: "latest advancements in quantum computing 2026"
max_results
number
default:10
Maximum number of results to return.
  • Minimum: 1
  • Maximum: 20
  • Default: 10
Example: 15
max_tokens_per_page
number
default:1024
Maximum tokens to extract from each webpage for the snippet.
  • Minimum: 256
  • Maximum: 2048
  • Default: 1024
Higher values provide more context but may increase processing time.Example: 512
country
string
ISO 3166-1 alpha-2 country code for regional search results.Use this to get results relevant to a specific geographic region.Examples: "US", "GB", "JP", "DE"

Response Format

The tool returns a formatted string containing search results:
results
string
Formatted search results with each entry containing:
  • Title: The page title
  • URL: The full URL to the page
  • Snippet: Extracted text from the page (up to max_tokens_per_page)
  • Date: Publication or last modified date (if available)

Example Response

Found 5 search results:

1. **Quantum Computing Breakthrough in 2026**
   URL: https://example.com/quantum-2026
   Scientists at MIT announced a major breakthrough in quantum error correction...
   Date: 2026-02-15

2. **Latest Quantum Processor Achieves 1000 Qubits**
   URL: https://techreview.example/quantum-processor
   A new quantum processor with 1000 stable qubits has been demonstrated...
   Date: 2026-02-10

3. **Quantum Computing Applications in Drug Discovery**
   URL: https://science.example.org/quantum-drugs
   Researchers used quantum computing to simulate complex molecular interactions...
   Date: 2026-01-28

Usage Examples

const result = await use_mcp_tool(
  "perplexity",
  "perplexity_search",
  {
    query: "Model Context Protocol MCP servers"
  }
);

Common Patterns

News Monitoring

Search for recent news and events:
const news = await use_mcp_tool(
  "perplexity",
  "perplexity_search",
  {
    query: "AI regulation legislation 2026",
    max_results: 10
  }
);

URL Discovery

Find official documentation or specific resources:
const docs = await use_mcp_tool(
  "perplexity",
  "perplexity_search",
  {
    query: "Anthropic Claude API documentation",
    max_results: 5
  }
);

Fact Verification

Gather multiple sources for fact-checking:
const sources = await use_mcp_tool(
  "perplexity",
  "perplexity_search",
  {
    query: "Mars rover discovery February 2026",
    max_results: 15
  }
);

Tips and Best Practices

Use specific queries: More specific search terms generally yield better results. Instead of “AI”, try “transformer model architecture explained”.
Adjust max_results: Start with 10 results and adjust based on your needs. More results provide broader coverage but take longer to process.
Combine with other tools: Use perplexity_search to discover sources, then perplexity_ask to synthesize information from those sources.
Search results may not include dates for all pages. The date field is optional and depends on the webpage’s metadata.

Comparison with Other Tools

Featureperplexity_searchperplexity_ask
OutputRaw search resultsAI-synthesized answer
CitationsAll results are citationsNumbered citations in text
SpeedFastFast
Best ForFinding URLs, sourcesGetting direct answers
ProcessingNone (raw results)AI interpretation
perplexity_search is the only tool that doesn’t use an AI model. It provides direct access to search results without interpretation.

Error Handling

Common errors and solutions:
  • Empty query: Ensure query parameter is a non-empty string
  • Invalid max_results: Must be between 1 and 20
  • Invalid max_tokens_per_page: Must be between 256 and 2048
  • Invalid country code: Use ISO 3166-1 alpha-2 format (2 letters)
  • Network errors: Check API key and internet connectivity

Ask Tool

Get AI-synthesized answers with citations instead of raw search results

Research Tool

Conduct deep multi-source research with comprehensive analysis

Build docs developers (and LLMs) love