Advanced MCP tool for Perplexity and OpenRouter API integration. Supports both simple and complex queries with file attachments.
Single tool 'ask_perplexity' has a comprehensive description (1,200+ chars) explaining use cases, query types, and pricing. Input schema is present with three parameters: query (string), query_type (enum: simple|complex), and attachment_paths (array of strings). All parameters have descriptions. However, the description is excessively long for LLM consumption (baseline 194 chars, p90=392; this is 3x the p90), which wastes tokens and buries key details. Output schema is not documented, LLMs cannot plan downstream actions or know what fields to expect. No error handling guidance provided. Tool name 'ask_perplexity' is clear and verb-forward, but the parameter descriptions lack format constraints (e.g., query length limits, file size limits for attachments). The attachment_paths parameter correctly documents the absolute path requirement, which is good, but no validation error messages are shown.
Perplexity is fundamentally an LLM that can search the internet, gather information, and answer users' queries. For example, let's suppose we want to find out the latest version of Python. 1. You would search on Google. 2. Then read the top two or three results directly to verify. Perplexity does that work for you. To answer a user's query, Perplexity searches, opens the top search results, finds information on those websites, and then provides the answer. Perplexity can be used with two types of queries: simple and complex. Choosing the right query type to fulfill the user's request is most important. SIMPLE Query: - Cheap and fast (on average, 10x cheaper and 3x faster than complex queries). - Suitable for straightforward questions such as "What is the latest version of Python?" - Pricing: $1/M input tokens, $1/M output tokens. COMPLEX Query: - Slower and more expensive (on average, 10x more expensive and 3x slower). - Suitable for tasks requiring multiple steps of reasoning or deep analysis, such as "Analyze the attached code to examine the current status of a specific library and create a migration plan." - Pricing: $1/M input tokens, $5/M output tokens. Instructions: - When reviewing the user's request, if you find anything unexpected, uncertain, or questionable, do not hesitate to use the "ask_perplexity" tool to consult Perplexity. - Since Perplexity is also an LLM, prompt engineering techniques are paramount. - Remember the basics of prompt engineering, such as providing clear instructions, sufficient context, and examples. - Include as much context and relevant files as possible to smoothly fulfill the user's request. - IMPORTANT: When adding files as attachments, you MUST use absolute paths (e.g., '/absolute/path/to/file.py'). Relative paths will not work. Note: All queries must be in English for optimal results.
Output schema not documented. LLMs cannot infer what fields the Perplexity API returns, preventing downstream tool chaining and forcing agents to guess at response structure.
Tool description is 1,200+ characters (3x the p90 baseline of 392). Excessive length wastes tokens and buries key details. Condense to ~150 - 250 chars with key facts: what it does, when to use it, and cost difference between simple/complex queries.
No error handling guidance. If a file attachment is invalid, the API key is missing, or the query fails, the tool provides no recovery hints. Add descriptions like 'If file not found, verify absolute path. If API fails, check PERPLEXITY_API_KEY environment variable.'
Parameter descriptions lack format constraints. 'query' has no length limits; 'attachment_paths' has no file size or count limits. Add: 'query: max 2000 chars', 'attachment_paths: max 5 files, each <10MB'.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 63 | <=2025-11-25 | v2 |
API key (PERPLEXITY_API_KEY) is injected server-side, which is correct. However, no documentation in the tool description or README explains how to set it or what happens if it's missing. Add a note: 'Requires PERPLEXITY_API_KEY environment variable.'