Skip to main content
Glama

get_protocol_info

Retrieve comprehensive DeFi protocol data including TVL, vault counts, versions, auditors, and security incidents for risk assessment and due diligence.

Instructions

Get detailed information about a DeFi protocol including TVL, vault count, versions, auditors, and security incidents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protocolIdYesProtocol ID (e.g. morpho, aave-v3, yearn-v3, beefy)

Implementation Reference

  • Main registration and handler for get_protocol_info tool. Defines the tool with Zod schema (protocolId parameter), executes API call to fetch protocol data, formats the response using formatProtocolInfo helper, and returns formatted text content.
    export function registerGetProtocolInfo(server: McpServer) { server.tool( 'get_protocol_info', 'Get detailed information about a DeFi protocol including TVL, vault count, versions, auditors, and security incidents.', { protocolId: z.string().describe('Protocol ID (e.g. morpho, aave-v3, yearn-v3, beefy)'), }, async (params) => { const result = await apiGet<{ data: any }>(`/v1/protocols/${params.protocolId}`); const text = formatProtocolInfo(result.data); return { content: [{ type: 'text' as const, text }] }; } ); }
  • src/server.ts:36-36 (registration)
    Tool registration call in createServer function that registers get_protocol_info with the MCP server instance.
    registerGetProtocolInfo(server);
  • Input validation schema using Zod that defines the protocolId parameter as a required string with description for protocol IDs like 'morpho', 'aave-v3', etc.
    { protocolId: z.string().describe('Protocol ID (e.g. morpho, aave-v3, yearn-v3, beefy)'), },
  • formatProtocolInfo helper function that takes API response data (protocol, vaults, versions, incidents) and formats it into a readable markdown string with sections for protocol details, versions, and security incidents.
    export function formatProtocolInfo(data: any): string { const { protocol, vaults, versions, incidents } = data; const sections = [ `## ${protocol.name}`, protocol.description ? `\n${protocol.description}` : '', `\n**TVL:** $${formatNumber(protocol.tvl_total)} | **Vaults:** ${protocol.vault_count}`, protocol.mainnet_launch_date ? `**Launch Date:** ${protocol.mainnet_launch_date}` : '', protocol.primary_auditors?.length ? `**Auditors:** ${protocol.primary_auditors.join(', ')}` : '', protocol.bug_bounty_url ? `**Bug Bounty:** ${protocol.bug_bounty_url}` : '', ].filter(Boolean); if (versions?.length) { sections.push('\n### Versions'); for (const v of versions) { sections.push( `- **${v.display_name || v.version}**: ${v.vault_count} vaults, $${formatNumber(v.tvl)} TVL` ); } } if (incidents?.length) { sections.push('\n### Security Incidents'); for (const i of incidents) { sections.push( `- **${i.title}** (${i.incident_severity || 'N/A'}) — ${new Date(i.occurred_at).toLocaleDateString()}` ); } } return sections.join('\n'); }
  • apiGet utility function used by the handler to make authenticated API requests to the Philidor API endpoint for fetching protocol information.
    export async function apiGet<T = any>(path: string): Promise<T> { const res = await fetch(`${API_BASE}${path}`, { headers: { Accept: 'application/json' }, }); if (!res.ok) { let message: string; try { const json = (await res.json()) as Record<string, any>; message = json?.error?.message || json?.message || JSON.stringify(json); } catch { message = res.statusText || `HTTP ${res.status}`; } throw new Error(`API ${res.status}: ${message}`); } const json = await res.json(); return json as T; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Philidor-Labs/philidor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server