Skip to main content
Glama

find_safest_vaults

Discover high-risk-scored DeFi vaults with filters for asset, chain, or TVL. Returns top 10 audited vaults sorted by risk score for due diligence.

Instructions

Find the safest (highest risk-scored) DeFi vaults, optionally filtered by asset, chain, or minimum TVL. Returns top 10 audited, high-confidence vaults sorted by risk score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetNoFilter by asset symbol (e.g. USDC, WETH)
chainNoFilter by chain name (e.g. Ethereum, Base)
minTvlNoMinimum TVL in USD

Implementation Reference

  • Main tool implementation: registerFindSafestVaults function that registers the MCP tool with the server. Contains the async handler (lines 15-47) that queries the API for audited vaults, filters and sorts them by risk score (total_score), and returns the top 10 safest vaults formatted with vault summaries.
    export function registerFindSafestVaults(server: McpServer) {
      server.tool(
        'find_safest_vaults',
        'Find the safest (highest risk-scored) DeFi vaults, optionally filtered by asset, chain, or minimum TVL. Returns top 10 audited, high-confidence vaults sorted by risk score.',
        {
          asset: z.string().optional().describe('Filter by asset symbol (e.g. USDC, WETH)'),
          chain: z.string().optional().describe('Filter by chain name (e.g. Ethereum, Base)'),
          minTvl: z.number().optional().describe('Minimum TVL in USD'),
        },
        async (params) => {
          const qs = buildQueryString({
            asset: params.asset,
            chain: params.chain,
            minTvl: params.minTvl,
            audited: true,
            sortBy: 'tvl_usd',
            sortOrder: 'desc',
            limit: 50,
            page: 1,
          });
    
          const result = await apiGet<{ data: any[]; meta: any }>(`/v1/vaults${qs}`);
          const vaults = result.data;
    
          const sorted = vaults
            .filter((v) => v.total_score !== null && v.total_score !== undefined)
            .sort((a, b) => (b.total_score ?? 0) - (a.total_score ?? 0))
            .slice(0, 10);
    
          if (!sorted.length) {
            return {
              content: [
                { type: 'text' as const, text: 'No audited vaults found matching the given criteria.' },
              ],
            };
          }
    
          const lines = sorted.map((v, i) => `**#${i + 1}**\n${formatVaultSummary(v)}`);
          const text = `## Top ${sorted.length} Safest Vaults\n\n` + lines.join('\n\n---\n\n');
    
          return { content: [{ type: 'text' as const, text }] };
        }
      );
    }
  • Input schema definition using Zod: defines three optional parameters - asset (string), chain (string), and minTvl (number) for filtering vaults.
    {
      asset: z.string().optional().describe('Filter by asset symbol (e.g. USDC, WETH)'),
      chain: z.string().optional().describe('Filter by chain name (e.g. Ethereum, Base)'),
      minTvl: z.number().optional().describe('Minimum TVL in USD'),
    },
  • src/server.ts:8-8 (registration)
    Import statement for the registerFindSafestVaults function from the tools module.
    import { registerFindSafestVaults } from './tools/find-safest-vaults';
  • src/server.ts:35-35 (registration)
    Registration call: invokes registerFindSafestVaults(server) to register the tool with the MCP server instance.
    registerFindSafestVaults(server);
  • Helper function formatVaultSummary that formats vault data into a readable markdown string including name, protocol, chain, asset, TVL, APR, risk score, and curator information. Used by the handler to format each vault in the results.
    export function formatVaultSummary(vault: any): string {
      const rs = vault.risk_score;
      const riskTier =
        vault.risk_tier ||
        (rs != null && rs >= 8
          ? 'Prime'
          : rs != null && rs >= 5
            ? 'Core'
            : rs != null
              ? 'Edge'
              : 'N/A');
      const score = vault.total_score ?? vault.risk_score ?? 'N/A';
      return [
        `## ${vault.name}`,
        `**Protocol:** ${vault.protocol_name} | **Chain:** ${vault.chain_name} | **Asset:** ${vault.asset_symbol || 'N/A'}`,
        `**TVL:** $${formatNumber(vault.tvl_usd)} | **APR:** ${formatPercent(vault.apr_net)}`,
        `**Risk Score:** ${score}/10 (${riskTier})`,
        vault.curator_name ? `**Curator:** ${vault.curator_name}` : null,
      ]
        .filter(Boolean)
        .join('\n');
    }
Behavior3/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. It discloses key behavioral traits: the tool returns a limited set ('top 10'), includes quality criteria ('audited, high-confidence'), and sorts by 'risk score'. However, it does not cover aspects like rate limits, authentication needs, error handling, or whether the operation is read-only or has side effects, leaving gaps for a tool with no annotation support.

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 and efficiently lists optional filters and output details in a single, well-structured sentence. Every element (e.g., 'top 10', 'audited', 'sorted by risk score') serves a clear purpose without redundancy, making it concise and easy to parse.

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 no annotations and no output schema, the description partially compensates by specifying the return format ('top 10 audited, high-confidence vaults sorted by risk score'). However, it lacks details on output structure, error cases, or behavioral constraints like pagination or rate limits. For a tool with 3 parameters and no structured support, it is adequate but has clear gaps in completeness.

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 parameters (asset, chain, minTvl) with descriptions. The description adds minimal value by mentioning these filters as optional but does not provide additional semantics, syntax, or format details beyond what the schema provides. Baseline 3 is appropriate when the schema handles parameter documentation.

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 specific action ('Find'), resource ('safest DeFi vaults'), and scope ('highest risk-scored'), distinguishing it from siblings like 'search_vaults' or 'get_vault' by emphasizing risk-based filtering and ranking. It explicitly mentions the output criteria ('top 10 audited, high-confidence vaults sorted by risk score'), making the purpose unambiguous.

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 usage by specifying optional filters (asset, chain, minTvl) and the focus on risk-scored vaults, but it does not explicitly state when to use this tool versus alternatives like 'search_vaults' or 'compare_vaults'. It implies usage for finding high-risk-scored vaults but lacks explicit exclusions or named alternatives.

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