agentfolio_endorsements
Retrieve endorsements for any agent: see who endorsed them and which skills were endorsed.
Instructions
Get endorsements for an agent — who endorsed them and what skills they endorsed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID to get endorsements for |
Implementation Reference
- src/index.js:402-416 (handler)Handler for agentfolio_endorsements: tries two API endpoints (/profile/{agent_id}/endorsements and /endorsements/{agent_id}) using apiSoft fallback, returns endorsements data or an error if both endpoints are unavailable.
case "agentfolio_endorsements": { // Try both possible endorsement endpoints const endorsements = await apiSoft( `/profile/${args.agent_id}/endorsements`, await apiSoft(`/endorsements/${args.agent_id}`, null) ); if (!endorsements) { return JSON.stringify({ agent_id: args.agent_id, error: "Endorsements endpoint is currently unavailable", note: "The AgentFolio endorsements API may be undergoing maintenance.", }, null, 2); } return JSON.stringify(endorsements, null, 2); } - src/index.js:195-209 (schema)Input schema for agentfolio_endorsements tool: requires agent_id (string) with no optional parameters.
{ name: "agentfolio_endorsements", description: "Get endorsements for an agent — who endorsed them and what skills they endorsed.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "Agent ID to get endorsements for", }, }, required: ["agent_id"], }, }, - src/index.js:437-440 (registration)The TOOLS array (which includes agentfolio_endorsements) is registered via the ListToolsRequestSchema handler, making the tool available to MCP clients.
// List tools server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); - src/index.js:442-456 (registration)The CallToolRequestSchema handler dispatches incoming tool calls to handleTool(), routing to the agentfolio_endorsements case in the switch statement.
// 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:52-59 (helper)The apiSoft helper used by the endorsements handler to gracefully fall back between API endpoints without throwing errors.
// Soft API call — returns fallback on error instead of throwing async function apiSoft(path, fallback = null) { try { return await api(path); } catch { return fallback; } }