Skip to main content
Glama

get_vault

Retrieve detailed DeFi vault analytics including risk scores, security assessments, and historical performance data to evaluate investment opportunities.

Instructions

Get detailed information about a specific DeFi vault including risk breakdown, recent events, and historical snapshots. Lookup by ID or by network + address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoVault ID (e.g. morpho-ethereum-0x...)
networkNoNetwork slug (e.g. ethereum, base, arbitrum)
addressNoVault contract address (0x...)

Implementation Reference

  • Main tool handler implementation for get_vault - defines the schema with optional id, network, and address parameters, and contains the async handler logic that fetches vault data from the API and formats the response using formatVaultDetail.
    export function registerGetVault(server: McpServer) {
      server.tool(
        'get_vault',
        'Get detailed information about a specific DeFi vault including risk breakdown, recent events, and historical snapshots. Lookup by ID or by network + address.',
        {
          id: z.string().optional().describe('Vault ID (e.g. morpho-ethereum-0x...)'),
          network: z.string().optional().describe('Network slug (e.g. ethereum, base, arbitrum)'),
          address: z.string().optional().describe('Vault contract address (0x...)'),
        },
        async (params) => {
          let data: any;
    
          if (params.id) {
            const result = await apiGet<{ data: any }>(`/v1/vaults/${params.id}`);
            data = result.data;
          } else if (params.network && params.address) {
            const result = await apiGet<{ data: any }>(`/v1/vault/${params.network}/${params.address}`);
            data = result.data;
          } else {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: 'Please provide either an `id` or both `network` and `address`.',
                },
              ],
              isError: true,
            };
          }
    
          const text = formatVaultDetail(data);
          return { content: [{ type: 'text' as const, text }] };
        }
      );
    }
  • formatVaultDetail helper function that formats the vault detail response into markdown, including risk breakdown, recent events, and historical APR calculations from snapshots.
    export function formatVaultDetail(data: { vault: any; snapshots: any[]; events: any[] }): string {
      const { vault, snapshots, events } = data;
      const sections = [formatVaultSummary(vault)];
    
      const apr7d = computeAvgApr(snapshots, 7);
      const apr30d = computeAvgApr(snapshots, 30);
      if (apr7d != null || apr30d != null) {
        const parts = [`**APR (current):** ${formatPercent(vault.apr_net)}`];
        if (apr7d != null) parts.push(`**APR (7d avg):** ${formatPercent(apr7d)}`);
        if (apr30d != null) parts.push(`**APR (30d avg):** ${formatPercent(apr30d)}`);
        sections.push(parts.join(' | '));
      }
    
      if (vault.risk_vectors) {
        sections.push('\n### Risk Breakdown');
        const rv = vault.risk_vectors;
        if (rv.asset) sections.push(`- **Asset Composition:** ${rv.asset.score}/10`);
        if (rv.platform)
          sections.push(
            `- **Platform Code:** ${rv.platform.score}/10 (Lindy: ${rv.platform.details?.lindyScore ?? 'N/A'}, Audit: ${rv.platform.details?.auditScore ?? 'N/A'})`
          );
        if (rv.control)
          sections.push(
            `- **Governance:** ${rv.control.score}/10${rv.control.details?.timelock ? ` (Timelock: ${formatTimelock(rv.control.details.timelock)})` : ''}`
          );
      }
    
      const meta: string[] = [];
      if (vault.audit_status) meta.push(`Audit: ${vault.audit_status}`);
      if (vault.strategy_type) meta.push(`Strategy: ${vault.strategy_type}`);
      if (vault.deployment_timestamp)
        meta.push(`Deployed: ${new Date(vault.deployment_timestamp).toLocaleDateString()}`);
      if (meta.length) sections.push('\n### Metadata\n' + meta.join(' | '));
    
      if (events?.length) {
        sections.push('\n### Recent Events');
        for (const e of events.slice(0, 5)) {
          sections.push(
            `- **${e.event_type}** (${e.severity}): ${e.title} — ${new Date(e.occurred_at).toLocaleDateString()}`
          );
        }
      }
    
      return sections.join('\n');
    }
  • src/server.ts:5-5 (registration)
    Import statement for registerGetVault tool registration function.
    import { registerGetVault } from './tools/get-vault';
  • src/server.ts:32-32 (registration)
    Registration call that registers the get_vault tool with the MCP server instance.
    registerGetVault(server);
  • apiGet helper function used by get_vault handler to make HTTP requests to 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;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation by using 'Get' and 'Lookup', which is appropriate, but lacks details on permissions, rate limits, error handling, or response format. It adds some context about the data scope (risk, events, snapshots), but more behavioral traits would improve transparency for this unannotated tool.

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

Conciseness5/5

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

The description is front-loaded with the core purpose in the first sentence, followed by a concise second sentence on lookup methods. Both sentences earn their place by adding distinct value—no wasted words or redundancy. It is appropriately sized for a tool with three parameters and no annotations.

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 (3 parameters, no annotations, no output schema), the description is partially complete. It covers the purpose and lookup methods well, but lacks details on behavioral aspects like response structure, error cases, or prerequisites. Without annotations or output schema, more context would help the agent use this tool effectively, though it's not critically inadequate.

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%, so the schema already documents all three parameters (id, network, address) with descriptions. The description adds marginal value by clarifying that these are alternative lookup methods ('by ID or by network + address'), but does not provide additional syntax, format, or usage details beyond what the schema specifies. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the action ('Get detailed information') and resource ('specific DeFi vault'), specifying the type of information returned ('risk breakdown, recent events, and historical snapshots'). It distinguishes from siblings like 'get_vault_risk_breakdown' by offering broader details beyond just risk, and from 'search_vaults' by focusing on a single vault lookup rather than multiple results.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: to retrieve comprehensive data on a single vault, using either an ID or network+address combination. However, it does not explicitly state when not to use it (e.g., vs. 'search_vaults' for multiple vaults or 'get_vault_risk_breakdown' for risk-only info), nor does it name alternatives, leaving some ambiguity in sibling tool selection.

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