domains / agent-tooling / web-search / perplexity
The two skills describe fundamentally different implementations of the 'perplexity' skill. The first (softaworks) is a routing and policy skill for an agent using MCP tools (Perplexity Search/Ask), defining when to use them versus other tools like Context7 or Graphite, and explicitly prohibiting a specific research tool. The second (LeoYeAI) is a standalone CLI wrapper skill that executes a Node.js script to call the Perplexity API directly, requiring an API key. They do not reproduce each other; one is a decision framework for tool selection, and the other is a direct execution script. Combining them is necessary to capture both the high-level routing logic and the low-level API execution method.
| Repository | Path |
|---|---|
| softaworks/agent-toolkit | dist/plugins/perplexity/skills/perplexity/SKILL.md |
| LeoYeAI/openclaw-master-skills | skills/perplexity/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | softaworks/agent-toolkit | dist/plugins/perplexity/skills/perplexity/SKILL.md |
| peer | LeoYeAI/openclaw-master-skills | skills/perplexity/SKILL.md |
| adapter | softaworks/agent-toolkit | skills/perplexity/SKILL.md |
---
name: perplexity
description: Web search and research using Perplexity AI. Supports MCP tool routing and direct API script execution.
---
# Perplexity Tools
This skill provides two methods for using Perplexity: MCP tool routing for agent workflows and a direct CLI script for standalone API calls.
## Method 1: MCP Tool Routing (Agent Workflows)
Use this method when operating within an agent environment that has access to Perplexity MCP tools.
### Tool Selection Chain
1. **Context7 MCP**: For library/framework docs.
2. **Graphite MCP**: For `gt` CLI mentions.
3. **Nx MCP**: For workspace-specific questions.
4. **Perplexity Search**: For generic searches.
5. **Perplexity Ask**: For conversational answers.
6. **Researcher Agent**: For deep multi-source research (use `/research <topic>`).
7. **WebSearch**: Last resort.
### Perplexity Search
Use for generic searches, finding resources, or current best practices.
**Default Parameters:**
```typescript
mcp__perplexity__perplexity_search({
query: "your search query",
max_results: 3,
max_tokens_per_page: 512
})
```
**Increased Limits (Sparingly):**
```typescript
mcp__perplexity__perplexity_search({
query: "complex topic",
max_results: 5,
max_tokens_per_page: 1024
})
```
### Perplexity Ask
Use for conversational explanations or synthesizing information.
```typescript
mcp__perplexity__perplexity_ask({
messages: [
{
role: "user",
content: "Explain how postgres advisory locks work"
}
]
})
```
### Prohibited
- **NEVER use** `mcp__perplexity__perplexity_research`. Use the Researcher agent instead.
## Method 2: Direct API Script (Standalone)
Use this method when you have direct access to the Perplexity API key and need to run searches via a script.
### Requirements
- `PERPLEXITY_API_KEY` environment variable must be set.
- Node.js must be installed.
### Usage
Single query:
```bash
node {baseDir}/scripts/search.mjs "what's happening in AI today"
```
Batch queries:
```bash
node {baseDir}/scripts/search.mjs "What is Perplexity?" "Latest AI news" "Best coffee in NYC"
```
### Options
- `--json`: Output raw JSON response.
## Key Points
- **MCP Context**: Always check for specific MCPs (Context7, Graphite, Nx) before using Perplexity MCP tools.
- **API Context**: Use the script for direct, unmediated API calls when MCP tools are unavailable or inappropriate.
- **Citations**: Both methods aim to provide grounded responses with citations where available.