search_advanced
Search Perplexity.ai with specific source selection to combine web, academic, and social sources for queries where source control matters.
Instructions
Search Perplexity.ai with specific source selection. Lets you combine multiple sources (e.g. web + academic). Use this when source control matters; prefer search for general queries.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query | |
| sources | Yes | Sources to search: 'web' (general web), 'academic' (scholarly articles), 'social' (Reddit & forums). Can combine multiple. |
Implementation Reference
- src/index.ts:53-57 (handler)Tool execution handler for search_advanced, which invokes searchWithSources.
execute: async ({ query, sources }) => { await ensureBrowser(); const result = await searchWithSources(query, TIMEOUT_MS, sources); return formatResult(result); }, - src/search.ts:31-34 (handler)Handler implementation for searching with specific sources, which calls runSearch.
export async function searchWithSources(query: string, timeoutMs: number, sources: string[]): Promise<SearchResult> { log(`Search: "${query}" sources=[${sources.join(",")}] (timeout: ${timeoutMs}ms)`); return runSearch(query, timeoutMs, sources); } - src/index.ts:42-58 (registration)Registration of the search_advanced MCP tool.
mcp.addTool({ name: "search_advanced", description: "Search Perplexity.ai with specific source selection. Lets you combine multiple sources (e.g. web + academic). Use this when source control matters; prefer `search` for general queries.", parameters: z.object({ query: z.string().describe("The search query"), sources: z .array(z.enum(["web", "academic", "social"])) .min(1) .describe("Sources to search: 'web' (general web), 'academic' (scholarly articles), 'social' (Reddit & forums). Can combine multiple."), }), execute: async ({ query, sources }) => { await ensureBrowser(); const result = await searchWithSources(query, TIMEOUT_MS, sources); return formatResult(result); }, });