agentfolio_lookup
Retrieve an AI agent's profile from AgentFolio, including bio, skills, trust score, verifications, and wallet addresses, by agent ID or name.
Instructions
Look up an AI agent's profile on AgentFolio. Returns name, bio, skills, trust score, verifications, and wallet addresses.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID to look up (e.g. "agent_braingrowth"). Can also be an agent name — it will be normalized. |
Implementation Reference
- src/index.js:215-218 (handler)The handler function for the 'agentfolio_lookup' tool. It calls the API endpoint /profile/{agent_id} and returns the profile data as a formatted JSON string.
case "agentfolio_lookup": { const profile = await api(`/profile/${args.agent_id}`); return JSON.stringify(profile, null, 2); } - src/index.js:62-78 (schema)The tool registration definition in the TOOLS array, including name, description, and inputSchema (requires agent_id string).
const TOOLS = [ { name: "agentfolio_lookup", description: "Look up an AI agent's profile on AgentFolio. Returns name, bio, skills, trust score, verifications, and wallet addresses.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: 'Agent ID to look up (e.g. "agent_braingrowth"). Can also be an agent name — it will be normalized.', }, }, required: ["agent_id"], }, }, - src/index.js:437-456 (registration)The tool is registered with the MCP server via the ListToolsRequestSchema handler (which returns the TOOLS array) and the CallToolRequestSchema handler (which routes to handleTool).
// List tools server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); // Call tool server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await handleTool(name, args || {}); return { content: [{ type: "text", text: result }], }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true, }; } }); - src/index.js:31-50 (helper)The 'api' helper function used by the handler to make HTTP requests to the AgentFolio API (https://agentfolio.bot/api).
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(); }