agentfolio_verify
Verify an agent's trustworthiness by checking their trust score, verification proofs, endorsements, and on-chain identity on AgentFolio.
Instructions
Check an agent's trust score and verification details on AgentFolio. Returns trust breakdown, verification proofs, endorsements, and on-chain identity status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID to verify |
Implementation Reference
- src/index.js:109-123 (registration)Tool 'agentfolio_verify' is registered in the TOOLS array with its name, description, and inputSchema (which takes a required 'agent_id' string).
{ name: "agentfolio_verify", description: "Check an agent's trust score and verification details on AgentFolio. Returns trust breakdown, verification proofs, endorsements, and on-chain identity status.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "Agent ID to verify", }, }, required: ["agent_id"], }, }, - src/index.js:272-297 (handler)Handler function for 'agentfolio_verify'. Fetches the agent's profile via API, then also fetches endorsements (with a fallback), and returns a JSON response containing trust score, verifications, wallets, endorsements, skills, and on-chain status.
case "agentfolio_verify": { const profile = await api(`/profile/${args.agent_id}`); // Endorsement endpoints are currently unavailable const endorsements = await apiSoft( `/profile/${args.agent_id}/endorsements`, await apiSoft(`/endorsements/${args.agent_id}`, { received: [], given: [] }) ); return JSON.stringify( { agent_id: profile.id, name: profile.name, trust_score: profile.trustScore ?? null, verifications: profile.verifications || [], wallets: profile.wallets || {}, endorsements_received: endorsements?.received || endorsements?.endorsements || [], endorsements_given: endorsements?.given || [], skills: (profile.skills || []).map((s) => ({ name: typeof s === "string" ? s : s.name, verified: typeof s === "object" ? s.verified : undefined, })), on_chain: (profile.verifications || []).includes("solana"), }, null, 2 ); } - src/index.js:31-50 (helper)The 'api' helper function used by the handler to make HTTP requests to the AgentFolio API base URL. It adds JSON content-type headers and validates that responses are proper JSON (not HTML error pages).
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(); } - src/index.js:53-59 (helper)The 'apiSoft' helper function wraps 'api' with error handling, returning a fallback value instead of throwing. Used by the handler for the optional endorsements lookup that may be unavailable.
async function apiSoft(path, fallback = null) { try { return await api(path); } catch { return fallback; } }