Skip to main content
Glama

get_vault_risk_breakdown

Analyze DeFi vault risk by retrieving detailed breakdowns of asset composition, platform code, and governance scores with sub-metrics for due diligence.

Instructions

Get a detailed breakdown of a vault's risk vectors: Asset Composition, Platform Code, and Governance scores with sub-metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork slug (e.g. ethereum, base, arbitrum)
addressYesVault contract address (0x...)

Implementation Reference

  • Main handler function that executes the get_vault_risk_breakdown tool logic. Fetches vault data via API, extracts risk vectors, and formats a detailed breakdown of Asset Composition, Platform Code, and Governance scores with sub-metrics into a human-readable markdown response.
    async (params) => {
      const result = await apiGet<{ data: any }>(`/v1/vault/${params.network}/${params.address}`);
      const vault = result.data.vault;
    
      const round = (n: number) => Math.round(n * 100) / 100;
    
      const sections = [
        `## Risk Breakdown: ${vault.name}`,
        `**Overall Score:** ${round(vault.total_score ?? vault.risk_score ?? 0)}/10 (${vault.risk_tier})`,
      ];
    
      const rv = vault.risk_vectors;
      if (!rv) {
        sections.push('\nNo detailed risk vector data available for this vault.');
        return { content: [{ type: 'text' as const, text: sections.join('\n') }] };
      }
    
      // Asset Composition
      sections.push('\n### Vector 1: Asset Composition (40% weight)');
      if (rv.asset) {
        sections.push(`**Score:** ${round(rv.asset.score)}/10`);
        if (rv.asset.details?.breakdown?.length) {
          sections.push('**Collateral mix:**');
          for (const item of rv.asset.details.breakdown) {
            const weight = (item.weight * 100).toFixed(1);
            sections.push(`- ${item.asset}: ${item.score}/10 (${weight}% weight)`);
          }
        }
      } else {
        sections.push('No asset composition data.');
      }
    
      // Platform Code
      sections.push('\n### Vector 2: Platform Code (40% weight)');
      if (rv.platform) {
        sections.push(`**Score:** ${round(rv.platform.score)}/10`);
        if (rv.platform.details) {
          const d = rv.platform.details;
          if (d.lindyScore !== undefined)
            sections.push(`- Lindy Score (time-based safety): ${round(d.lindyScore)}/10`);
          if (d.auditScore !== undefined)
            sections.push(`- Audit Density Score: ${d.auditScore}/10`);
          if (d.dependencyCount !== undefined)
            sections.push(`- Dependencies: ${d.dependencyCount}`);
          if (d.dependencies?.length) {
            for (const dep of d.dependencies) {
              sections.push(
                `  - ${dep.protocolId}: score ${dep.score}/10, safety factor ${dep.safetyFactor}x`
              );
            }
          }
          if (d.daysSinceIncident !== undefined)
            sections.push(`- Days Since Incident: ${d.daysSinceIncident}`);
          if (d.incidentPenaltyApplied)
            sections.push(
              `- Incident Penalty: Applied (capped at ${d.incidentPenaltyCap ?? 'N/A'})`
            );
        }
      } else {
        sections.push('No platform code data.');
      }
    
      // Governance
      sections.push('\n### Vector 3: Governance (20% weight)');
      if (rv.control) {
        sections.push(`**Score:** ${round(rv.control.score)}/10`);
        if (rv.control.details) {
          const d = rv.control.details;
          if (d.isImmutable !== undefined)
            sections.push(`- Immutable: ${d.isImmutable ? 'Yes' : 'No'}`);
          if (d.timelock !== undefined) {
            const hours = Math.floor(d.timelock / 3600);
            const days = Math.floor(d.timelock / 86400);
            sections.push(
              `- Timelock: ${d.timelock >= 86400 ? `${days} days` : `${hours} hours`} (${d.timelock}s)`
            );
          }
          if (d.governanceType) sections.push(`- Governance Type: ${d.governanceType}`);
        }
      } else {
        sections.push('No governance data.');
      }
    
      return { content: [{ type: 'text' as const, text: sections.join('\n') }] };
    }
  • Tool registration with schema definition. Defines the tool name 'get_vault_risk_breakdown', its description, and the input schema with two required parameters: network (string) and address (string).
    export function registerGetVaultRiskBreakdown(server: McpServer) {
      server.tool(
        'get_vault_risk_breakdown',
        "Get a detailed breakdown of a vault's risk vectors: Asset Composition, Platform Code, and Governance scores with sub-metrics.",
        {
          network: z.string().describe('Network slug (e.g. ethereum, base, arbitrum)'),
          address: z.string().describe('Vault contract address (0x...)'),
        },
  • src/server.ts:6-6 (registration)
    Import statement for the registerGetVaultRiskBreakdown function.
    import { registerGetVaultRiskBreakdown } from './tools/get-vault-risk-breakdown';
  • src/server.ts:33-33 (registration)
    Tool registration call that registers get_vault_risk_breakdown with the MCP server instance.
    registerGetVaultRiskBreakdown(server);
  • API client helper function used by the handler to fetch vault data from the Philidor API endpoint.
    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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a 'detailed breakdown' with three score types, but doesn't specify output format (e.g., structured data, text summary), potential errors (e.g., invalid address handling), rate limits, or authentication needs. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Get a detailed breakdown') and lists key components. There's no wasted text, and it directly communicates the tool's function. However, it could be slightly more structured (e.g., bullet points for clarity) but remains highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (risk analysis with multiple score types), no annotations, and no output schema, the description is minimally adequate. It covers what the tool does but lacks details on output format, error handling, or integration with siblings. Without annotations or output schema, more context on behavioral aspects would improve completeness for safe agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('network', 'address') fully documented in the schema. The description adds no additional parameter semantics beyond what the schema provides (e.g., no examples of valid network slugs beyond 'ethereum', no clarification on address format). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get a detailed breakdown') and resources ('vault's risk vectors'), listing the three main components (Asset Composition, Platform Code, Governance scores). It distinguishes itself from siblings like 'get_vault' or 'explain_risk_score' by focusing on risk breakdown rather than general vault data or score explanations. However, it doesn't explicitly contrast with all siblings (e.g., 'compare_vaults' also involves risk analysis).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a specific vault address), exclusions (e.g., not for comparing multiple vaults), or direct comparisons to sibling tools like 'explain_risk_score' (for detailed score explanations) or 'compare_vaults' (for multi-vault analysis). Usage is implied only through the tool name and description context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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