Skip to main content
Glama

get_market_overview

Analyze DeFi vault market trends with total TVL, vault count, risk distribution, and protocol-level TVL data for comprehensive market assessment.

Instructions

Get a high-level overview of the DeFi vault market: total TVL, vault count, risk distribution, and TVL by protocol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler implementation for get_market_overview tool. Registers the tool, calls the API endpoint '/v1/stats', formats the response, and returns it as text content.
    export function registerGetMarketOverview(server: McpServer) {
      server.tool(
        'get_market_overview',
        'Get a high-level overview of the DeFi vault market: total TVL, vault count, risk distribution, and TVL by protocol.',
        {},
        async () => {
          const result = await apiGet<{ data: any }>('/v1/stats');
          const text = formatStats(result.data);
          return { content: [{ type: 'text' as const, text }] };
        }
      );
    }
  • src/server.ts:38-39 (registration)
    Registration call in server.ts that activates the get_market_overview tool during server initialization.
    registerGetMarketOverview(server);
    registerExplainRiskScore(server);
  • Helper function that formats the market stats API response into a human-readable markdown format with total vaults, TVL, APR, risk distribution, and TVL by protocol.
    export function formatStats(stats: any): string {
      const sections = [
        '## Philidor DeFi Vault Market Overview',
        `\n**Total Vaults:** ${stats.totalVaults}`,
        `**Total TVL:** $${formatNumber(stats.totalTvl)}`,
        `**Average APR:** ${formatPercent(stats.avgApr)}`,
        `**Protocols:** ${stats.protocolCount} | **Curators:** ${stats.curatorCount} | **Chains:** ${stats.chainCount}`,
      ];
    
      if (stats.riskDistribution?.length) {
        sections.push('\n### Risk Distribution');
        for (const r of stats.riskDistribution) {
          sections.push(`- **${r.risk_tier}**: ${r.count} vaults, $${formatNumber(r.tvl)} TVL`);
        }
      }
    
      if (stats.tvlByProtocol?.length) {
        sections.push('\n### TVL by Protocol');
        for (const p of stats.tvlByProtocol.slice(0, 10)) {
          sections.push(`- **${p.name}**: $${formatNumber(p.tvl)} (${p.vault_count} vaults)`);
        }
      }
    
      return sections.join('\n');
    }
  • Helper function that makes HTTP GET requests to the Philidor API endpoint, handling errors and returning typed JSON responses.
    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 full burden. It states what data is returned but does not disclose behavioral traits like data freshness (real-time vs. cached), rate limits, authentication needs, or error conditions. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the purpose and lists key metrics. Every word contributes to understanding the tool's function without redundancy or fluff.

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 provides basic purpose but lacks behavioral context (e.g., data sources, update frequency) and output details (e.g., format of risk distribution). It is minimally adequate but has clear gaps for a tool returning complex market data.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, earning a baseline score of 4 for not adding unnecessary information.

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 ('Get a high-level overview') and resource ('DeFi vault market'), listing concrete metrics (total TVL, vault count, risk distribution, TVL by protocol). It distinguishes from siblings like get_vault (single vault) or get_protocol_info (protocol-specific) by focusing on aggregate market data.

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

Usage Guidelines3/5

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

The description implies usage for high-level market analysis, but does not explicitly state when to use this tool versus alternatives like get_vault_risk_breakdown (detailed risk) or search_vaults (filtered vaults). No exclusions or prerequisites are mentioned.

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