find_apis
Identify and compare external APIs or real-time data services based on specific requirements. Ideal for selecting solutions like image recognition or payment processing APIs, tailored to project needs such as free tiers or SDK compatibility.
Instructions
Automatically call this tool when needing external services or real time current data (like API info, latest versions, etc.) from web. Compares options based on requirements. Example: When building a shopping site, ask "Find product image APIs with free tiers".
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Additional context about the project or specific needs | |
| requirement | Yes | The functionality or requirement you are looking to fulfill |
Implementation Reference
- src/server/PerplexityServer.ts:130-136 (handler)The main handler function for the 'find_apis' tool. It extracts arguments and performs a web search using the search engine for APIs matching the requirement.private async handleFindApis(args: Record<string, unknown>): Promise<string> { const typedArgs = args as { requirement: string; context?: string }; const searchResult = await this.searchEngine.performSearch( `Find APIs for ${typedArgs.requirement}: ${typedArgs.context || ""}`, ); return searchResult; }
- src/server/PerplexityServer.ts:176-183 (registration)Registers the 'find_apis' handler (along with others) into the tool handlers registry and sets it up on the MCP server.const toolHandlers = createToolHandlersRegistry({ chat_perplexity: this.handleChatPerplexity.bind(this), get_documentation: this.handleGetDocumentation.bind(this), find_apis: this.handleFindApis.bind(this), check_deprecated_code: this.handleCheckDeprecatedCode.bind(this), search: this.handleSearch.bind(this), extract_url_content: this.handleExtractUrlContent.bind(this), });
- src/schema/toolSchemas.ts:241-290 (schema)Complete schema definition for the 'find_apis' tool, including description, inputSchema (requirement, context), outputSchema, examples, and metadata.name: "find_apis", description: 'Automatically call this tool when needing external services or real time current data (like API info, latest versions, etc.) from web. Compares options based on requirements. Example: When building a shopping site, ask "Find product image APIs with free tiers".', category: "API Discovery", keywords: ["api", "integration", "services", "endpoints", "sdk", "data", "external"], use_cases: [ "Finding APIs for specific functionality", "Comparing API alternatives", "Evaluating API suitability", ], inputSchema: { type: "object", properties: { requirement: { type: "string", description: "The functionality or requirement you are looking to fulfill", examples: ["image recognition", "payment processing", "geolocation services"], }, context: { type: "string", description: "Additional context about the project or specific needs", examples: ["prefer free tier options", "must support Python SDK"], }, }, required: ["requirement"], }, outputSchema: { type: "object", properties: { response: { type: "string", description: "The raw text response from Perplexity containing API suggestions and evaluations.", }, }, }, examples: [ { description: "Finding payment APIs", input: { requirement: "payment processing", context: "needs Stripe alternative", }, output: { response: "PayPal offers global payment processing with 2.9% + $0.30 per transaction...", }, }, ], related_tools: ["get_documentation", "search"], },
- src/types/tools.ts:44-47 (schema)TypeScript interface defining the input arguments for the 'find_apis' tool.export interface FindApisArgs { requirement: string; context?: string; }
- src/tools/findApis.ts:10-31 (helper)Detailed helper function for 'find_apis' with comprehensive prompt for API discovery and evaluation (not directly registered in PerplexityServer).export default async function findApis( args: { requirement: string; context?: string }, ctx: PuppeteerContext, performSearch: (prompt: string, ctx: PuppeteerContext) => Promise<string>, ): Promise<string> { const { requirement, context = "" } = args; const prompt = `Find and evaluate APIs that could be used for: ${requirement}. ${ context ? `Context: ${context}` : "" } For each API, provide: 1. Name and brief description 2. Key features and capabilities 3. Pricing model and rate limits 4. Authentication methods 5. Integration complexity 6. Documentation quality and examples 7. Community support and popularity 8. Any potential limitations or concerns 9. Code examples for basic usage 10. Comparison with similar APIs 11. SDK availability and language support`; return await performSearch(prompt, ctx); }