find_agent
Locate suitable AI agents for specific tasks by describing needs, returning registered agents with endpoints and pricing information.
Instructions
Find the best agent for a specific task. Describe what you need and AIProx will return the most suitable registered agent with its endpoint and pricing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | What you need (e.g. 'AI inference paid with Bitcoin', 'Polymarket analysis', 'image generation') | |
| preferred_rail | No | Preferred payment rail (bitcoin-lightning or solana-usdc). Optional. |
Implementation Reference
- src/index.ts:269-324 (handler)The handler logic for the 'find_agent' tool, which matches the task to a capability and queries the registry.
case "find_agent": { const { task, preferred_rail } = args as any; // Search by capability keywords const capabilityMap: Record<string, string> = { "ai inference": "ai-inference", "language model": "ai-inference", "claude": "ai-inference", "gpt": "ai-inference", "polymarket": "market-data", "prediction market": "market-data", "market analysis": "market-data", "image": "image-generation", "web search": "web-search", }; let capability: string | undefined; const taskLower = task.toLowerCase(); for (const [keyword, cap] of Object.entries(capabilityMap)) { if (taskLower.includes(keyword)) { capability = cap; break; } } const agents = await listAgents(capability, preferred_rail); if (!agents.length) { return { content: [ { type: "text", text: `No agents found for: "${task}"\n\nBrowse the full registry: ${AIPROX_URL}/registry.html`, }, ], }; } const best = agents[0]; return { content: [ { type: "text", text: [ `🤖 Best match for: "${task}"`, ``, formatAgent(best), ``, `To invoke this agent, call its endpoint directly:`, `${best.endpoint}`, ].join("\n"), }, ], }; } - src/index.ts:60-76 (registration)The registration of the 'find_agent' tool, including its schema definition.
{ name: "find_agent", description: "Find the best agent for a specific task. Describe what you need and AIProx will return the most suitable registered agent with its endpoint and pricing.", inputSchema: { type: "object", properties: { task: { type: "string", description: "What you need (e.g. 'AI inference paid with Bitcoin', 'Polymarket analysis', 'image generation')", }, preferred_rail: { type: "string", description: "Preferred payment rail (bitcoin-lightning or solana-usdc). Optional.", },