agentfolio_search
Search for AI agents by skill, name, or keyword. Filter by trust score and category to find verified agent profiles.
Instructions
Search for AI agents on AgentFolio by skill, name, or keyword. Filter by minimum trust score. Returns matching agent profiles.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query — matches name, bio, and skills | |
| skill | No | Filter by specific skill name | |
| category | No | Filter by skill category | |
| min_trust | No | Minimum trust score (0-100+). Default: 0 | |
| limit | No | Max results to return. Default: 10 |
Implementation Reference
- src/index.js:83-107 (schema)Input schema for the agentfolio_search tool, defining parameters: query (string), skill (string), category (string), min_trust (number), limit (number).
inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query — matches name, bio, and skills", }, skill: { type: "string", description: "Filter by specific skill name", }, category: { type: "string", description: "Filter by skill category", }, min_trust: { type: "number", description: "Minimum trust score (0-100+). Default: 0", }, limit: { type: "number", description: "Max results to return. Default: 10", }, }, }, - src/index.js:220-270 (handler)Handler for agentfolio_search. Fetches all profiles from /api/profiles, then performs client-side filtering by query (name/bio/skills), min_trust, skill, and category. Returns matching results up to the limit.
case "agentfolio_search": { // /api/search is currently unavailable — fall back to client-side filtering of /api/profiles const profilesData = await api("/profiles"); const allProfiles = profilesData.profiles || []; const query = (args.query || "").toLowerCase(); const minTrust = args.min_trust || 0; const limit = args.limit || 10; let filtered = allProfiles; if (query) { filtered = filtered.filter((p) => { const name = (p.name || "").toLowerCase(); const bio = (p.bio || p.description || "").toLowerCase(); const skills = (p.skills || []) .map((s) => (typeof s === "string" ? s : s.name || "").toLowerCase()) .join(" "); return name.includes(query) || bio.includes(query) || skills.includes(query); }); } if (minTrust > 0) { filtered = filtered.filter((p) => (p.trustScore || 0) >= minTrust); } if (args.skill) { const sk = args.skill.toLowerCase(); filtered = filtered.filter((p) => (p.skills || []).some((s) => (typeof s === "string" ? s : s.name || "").toLowerCase().includes(sk) ) ); } if (args.category) { const cat = args.category.toLowerCase(); filtered = filtered.filter((p) => (p.skills || []).some( (s) => typeof s === "object" && (s.category || "").toLowerCase().includes(cat) ) ); } return JSON.stringify( { query: args.query || "", count: filtered.length, results: filtered.slice(0, limit), note: "Search performed client-side against agent directory. Some profile fields may be limited.", totalRegistered: profilesData.total || 0, }, null, 2 ); } - src/index.js:79-80 (registration)Tool registration entry in the TOOLS array. Defines name 'agentfolio_search' and its description.
{ name: "agentfolio_search", - src/index.js:31-50 (helper)The api() helper function used by the handler to make HTTP requests to the AgentFolio API backend.
async function api(path, opts = {}) { const url = `${API_BASE}${path}`; const res = await fetch(url, { headers: { "Content-Type": "application/json", ...opts.headers }, ...opts, }); if (!res.ok) { const body = await res.text().catch(() => ""); throw new Error(`AgentFolio API ${res.status}: ${body}`); } // Guard against HTML error pages returned with 200 const ct = res.headers.get("content-type") || ""; if (!ct.includes("application/json")) { const body = await res.text().catch(() => ""); if (body.includes("<!DOCTYPE") || body.includes("<html")) { throw new Error(`AgentFolio API returned HTML instead of JSON for ${path}`); } } return res.json(); }