Skip to main content
Glama

explain_risk_score

Explains Philidor risk scores by detailing tier classification (Prime/Core/Edge), calculation methodology, and threshold values for DeFi vault analysis.

Instructions

Explain what a Philidor risk score means, including the tier (Prime/Core/Edge), how it is calculated, and what the thresholds are.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scoreYesRisk score (0-10) to explain

Implementation Reference

  • Tool registration and handler function that defines the explain_risk_score tool, validates input using Zod schema, and calls formatRiskScoreExplanation to generate the response.
    export function registerExplainRiskScore(server: McpServer) {
      server.tool(
        'explain_risk_score',
        'Explain what a Philidor risk score means, including the tier (Prime/Core/Edge), how it is calculated, and what the thresholds are.',
        {
          score: z.number().min(0).max(10).describe('Risk score (0-10) to explain'),
        },
        async (params) => {
          const text = formatRiskScoreExplanation(params.score);
          return { content: [{ type: 'text' as const, text }] };
        }
      );
    }
  • Input schema definition using Zod: requires a score parameter (number, min 0, max 10) representing the risk score to explain.
      score: z.number().min(0).max(10).describe('Risk score (0-10) to explain'),
    },
  • Core implementation logic that determines the risk tier (Prime/Core/Edge) based on score thresholds and generates detailed explanation including calculation methodology and tier definitions.
    export function formatRiskScoreExplanation(score: number): string {
      let tier: string, meaning: string;
      if (score >= 8) {
        tier = 'Prime';
        meaning =
          'This is a high-safety vault. It typically features mature code (>2 years), multiple independent audits, and safe governance (long timelocks or immutable contracts).';
      } else if (score >= 5) {
        tier = 'Core';
        meaning =
          'This is a moderate-safety vault. It is likely audited but may be newer or have more flexible governance (shorter timelocks).';
      } else {
        tier = 'Edge';
        meaning =
          'This is a higher-risk vault. It may be unaudited, very new, have instant admin powers, or recent security incidents.';
      }
    
      return [
        `## Risk Score: ${score}/10 — ${tier} Tier`,
        `\n${meaning}`,
        '\n### How the Score is Calculated',
        'The score is a weighted average of three risk vectors:',
        '- **Asset Composition (40%)**: Quality of underlying assets and collateral',
        '- **Platform Code (40%)**: Code maturity (Lindy effect), audit density, dependency risk, incident history',
        '- **Governance (20%)**: Admin controls, timelock duration, immutability',
        '\n### Tier Thresholds',
        '- **Prime (8.0-10.0)**: Highest safety — institutional-grade',
        '- **Core (5.0-7.9)**: Moderate safety — suitable with monitoring',
        '- **Edge (0.0-4.9)**: Higher risk — requires careful due diligence',
        '\n### Hard Disqualifications',
        'A vault is capped at Edge tier if: no audit exists for the protocol version, or the platform score is 0.',
      ].join('\n');
    }
  • src/server.ts:12-12 (registration)
    Import statement for registerExplainRiskScore function from the tools module.
    import { registerExplainRiskScore } from './tools/explain-risk-score';
  • src/server.ts:39-39 (registration)
    Registration call that registers the explain_risk_score tool with the MCP server instance.
    registerExplainRiskScore(server);
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 describes what the tool explains but lacks details on behavioral traits such as response format, potential errors (e.g., for invalid scores), or performance characteristics. 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, well-structured sentence that efficiently lists all key aspects (tier, calculation, thresholds) without unnecessary words. It is front-loaded with the core purpose and appropriately sized for the tool's complexity.

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 low complexity (1 parameter, no output schema, no annotations), the description is minimally complete but lacks depth. It covers what the tool explains but does not address behavioral aspects or output expectations, which are needed for full contextual understanding despite the simple schema.

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 the parameter 'score' documented as a number (0-10) to explain. The description does not add meaning beyond the schema, as it does not specify parameter usage or constraints. Baseline 3 is appropriate since the schema adequately covers parameter semantics.

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 tool's purpose: to explain a Philidor risk score, including tier classification, calculation methodology, and thresholds. It specifies the verb 'explain' and the resource 'risk score,' distinguishing it from sibling tools that focus on vault operations, comparisons, or searches rather than score interpretation.

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 implies usage when a user needs to understand a risk score's meaning, tiers, calculation, and thresholds. However, it does not explicitly state when to use this tool versus alternatives (e.g., get_vault_risk_breakdown for detailed risk components) or provide exclusions, leaving some ambiguity in sibling tool differentiation.

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