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
Theperplexity_reason tool provides advanced reasoning and analytical capabilities using the Sonar Reasoning Pro model. It excels at tasks requiring step-by-step logic, mathematical reasoning, and complex analytical thinking.
This tool uses the sonar-reasoning-pro model, which combines chain-of-thought reasoning with real-time web search for grounded, logical analysis.
Use Cases
- Mathematical problem solving
- Logical puzzles and brain teasers
- Product or option comparisons
- Complex argument analysis
- Scientific reasoning
- Code debugging and optimization
- Strategic decision making
Parameters
Array of conversation messages in OpenAI format.Each message must have:
role: One of"system","user", or"assistant"content: The message text (string)
If
true, removes <think>...</think> tags and their content from the response.The model includes step-by-step reasoning in <think> tags. Stripping these saves context tokens but hides the reasoning process.Default: false (shows thinking process)Example: trueFilter search results by how recent they are.Options:
"hour", "day", "week", "month", "year""hour": Very recent information (last 60 minutes)"day": Today’s updates (last 24 hours)"week": This week’s content"month": This month’s content"year": This year’s content
"week"Restrict or exclude specific domains from search results.
- Include domains:
["wikipedia.org", "arxiv.org"] - Exclude domains:
["-reddit.com", "-quora.com"](use-prefix)
["mathworld.wolfram.com", "arxiv.org"]Control how much web context is retrieved for reasoning.Options:
"low", "medium", "high""low"(default): Fastest, minimal context"medium": Balanced speed and context"high": Most comprehensive, slower
"high"Response Format
The tool returns a reasoned analysis with inline citations and optional thinking process:Analytical response with:
- Optional
<think>...</think>tags showing step-by-step reasoning (ifstrip_thinking: false) - Logical analysis with numbered citation references
[1],[2], etc. - Citations list appended at the end
Example Response
Usage Examples
Common Patterns
Mathematical Problem Solving
Solve complex math problems with step-by-step reasoning:Comparative Analysis
Compare options with detailed reasoning:Logical Puzzle Solving
Work through logic puzzles systematically:Strategic Decision Making
Analyze complex decisions with multiple factors:Advanced Usage
Multi-step Reasoning Chain
Build complex reasoning across multiple turns:Debugging with Context
Provide code context for detailed analysis:Understanding Thinking Tags
Whenstrip_thinking: false (default), responses include reasoning process:
- Problem-solving strategy
- Intermediate calculations
- Logical deductions
- Error checking
strip_thinking: true to get only the final answer.
Tips and Best Practices
Comparison with Other Tools
| Feature | perplexity_reason | perplexity_ask | perplexity_research |
|---|---|---|---|
| Model | sonar-reasoning-pro | sonar-pro | sonar-deep-research |
| Speed | Medium (5-15s) | Fast (< 5s) | Slow (30s+) |
| Reasoning | Chain-of-thought | Standard | Deep analysis |
| Best For | Logic & math | Quick Q&A | Literature reviews |
| Thinking Tags | Yes (optional) | No | Yes (optional) |
| Recency Filter | Yes | Yes | No |
| Domain Filter | Yes | Yes | No |
| Context Size | Adjustable | Adjustable | High (default) |
perplexity_reason is optimized for analytical tasks requiring logical thinking. For fact-based questions, use perplexity_ask. For comprehensive research, use perplexity_research.Error Handling
Common errors and solutions:- Invalid messages array: Ensure each message has
roleandcontentfields - Invalid role: Must be
"system","user", or"assistant" - Invalid recency filter: Must be
hour,day,week,month, oryear - Invalid context size: Must be
low,medium, orhigh - Network errors: Check API key and connectivity
Performance Optimization
Strip Thinking
Enable
strip_thinking: true to reduce response size by 15-25%Filter Domains
Limit to relevant domains to speed up search and improve quality
Adjust Context
Use
search_context_size: "low" for faster responses on simple problemsCache Results
Store solutions to common problems to avoid repeated API calls
Related Tools
Ask Tool
Use for straightforward factual questions without complex reasoning
Research Tool
Use for comprehensive multi-source research instead of analytical reasoning
Search Tool
Use to find sources and documentation before reasoning
Tools Overview
Compare all available tools and their capabilities