Skip to main content
Glama

Near-Liquidation Cohort Signals

query_cohort_critical

Monitor borrower health factor tiers to get early warning of near-liquidation cohorts. Track entry/exit rates and deterioration velocity for critical, high, and moderate tiers.

Instructions

Get near-liquidation cohort signals showing account populations by health factor tier (critical/high/moderate), entry/exit rates, and deterioration velocity. Early warning on borrowers entering critical health factor tiers. Source: Liquidationbot real-time telemetry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowNoTime window for aggregation (default: 1h)
networkNoFilter by blockchain network
protocolNoFilter by lending protocol

Implementation Reference

  • The 'query_cohort_critical' tool is registered via server.registerTool() in the registerCryptoTools() function.
    server.registerTool(
      "query_cohort_critical",
      {
        title: "Near-Liquidation Cohort Signals",
        description:
          "Get near-liquidation cohort signals showing account populations by health " +
          "factor tier (critical/high/moderate), entry/exit rates, and deterioration " +
          "velocity. Early warning on borrowers entering critical health factor tiers. " +
          "Source: Liquidationbot real-time telemetry.",
        inputSchema: {
          window: z
            .enum(["5m", "1h", "24h"])
            .optional()
            .describe("Time window for aggregation (default: 1h)"),
          network: z
            .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"])
            .optional()
            .describe("Filter by blockchain network"),
          protocol: z
            .enum([
              "aave_v3",
              "compound_v3",
              "venus",
              "radiant",
              "morpho_blue",
              "llamalend",
              "zerolend",
              "makerdao",
            ])
            .optional()
            .describe("Filter by lending protocol"),
        },
      },
      async ({ window, network, protocol }) => {
        const res = await apiGet<CryptoQueryResponse>(
          "/api/v1/crypto/cohorts/critical",
          {
            window: window ?? "1h",
            network,
            protocol,
          },
        );
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const summary = `Found ${count} cohort record(s) for window=${window ?? "1h"}.`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • The handler is an async callback passed to server.registerTool(). It calls apiGet to "/api/v1/crypto/cohorts/critical" and returns the response as text content.
    async ({ window, network, protocol }) => {
      const res = await apiGet<CryptoQueryResponse>(
        "/api/v1/crypto/cohorts/critical",
        {
          window: window ?? "1h",
          network,
          protocol,
        },
      );
    
      if (!res.ok) {
        return {
          content: [
            {
              type: "text" as const,
              text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
            },
          ],
          isError: true,
        };
      }
    
      const { count, data } = res.data;
      const summary = `Found ${count} cohort record(s) for window=${window ?? "1h"}.`;
      const json = JSON.stringify(data, null, 2);
    
      return {
        content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
      };
    },
  • Input schema using Zod: optional window (5m/1h/24h), optional network (6 chains), optional protocol (8 lending protocols).
    inputSchema: {
      window: z
        .enum(["5m", "1h", "24h"])
        .optional()
        .describe("Time window for aggregation (default: 1h)"),
      network: z
        .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"])
        .optional()
        .describe("Filter by blockchain network"),
      protocol: z
        .enum([
          "aave_v3",
          "compound_v3",
          "venus",
          "radiant",
          "morpho_blue",
          "llamalend",
          "zerolend",
          "makerdao",
        ])
        .optional()
        .describe("Filter by lending protocol"),
    },
  • The apiGet helper from src/client.ts is used by the handler to make HTTP GET requests to the Verilex API server.
    export async function apiGet<T = unknown>(
      path: string,
      params?: Record<string, string | number | undefined>,
    ): Promise<ApiResponse<T>> {
      const url = buildUrl(path, params);
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "verilex-mcp-server/0.1.0",
      };
    
      // Forward x402 payment token if present in env (for paid endpoints)
      const paymentToken = process.env.VERILEX_PAYMENT_TOKEN;
      if (paymentToken) {
        headers["X-Payment-Token"] = paymentToken;
      }
    
      const res = await fetch(url, { headers });
      const data = (await res.json()) as T;
    
      const stale = res.headers.get("X-Data-Stale");
      const lastUpdated = res.headers.get("X-Data-Last-Updated");
      const ageSeconds = res.headers.get("X-Data-Age-Seconds");
    
      return {
        ok: res.ok,
        status: res.status,
        data,
        stale: stale === "true",
        lastUpdated: lastUpdated ?? undefined,
        ageSeconds: ageSeconds ? Number(ageSeconds) : undefined,
      };
    }
  • The CryptoQueryResponse interface defines the shape of the API response used by the query_cohort_critical handler.
          if (v !== undefined && v !== "") {
            url.searchParams.set(k, String(v));
          }
        }
      }
      return url.toString();
    }
Behavior2/5

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

No annotations provided, so description must cover behavioral traits. It mentions 'real-time telemetry' and that it provides 'early warning', but does not state read-only nature, data latency, rate limits, or any constraints. Some transparency but significant gaps.

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?

Two sentences, front-loaded with key information. Every word serves a purpose, no redundancy. Highly concise and well-structured.

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

Completeness4/5

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

Despite no output schema, description provides good overview of return fields (populations by tier, entry/exit rates, velocity). Also includes data source. Complete enough for a query tool with well-defined parameters.

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 covers all 3 parameters with descriptions, and description adds no further meaning beyond what is in the schema. Baseline 3 for high coverage.

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 retrieves near-liquidation cohort signals with specific metrics (health factor tiers, entry/exit rates, velocity). It differentiates by mentioning 'Liquidationbot real-time telemetry' as source, but does not explicitly contrast with siblings like query_protocol_risk or query_network_stress.

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?

No explicit guidance on when to use this tool over alternatives. Implies use for early warning on critical health factor entries, but no exclusions, prerequisites, or comparisons to other query tools in the sibling list.

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/carrierone/verilexdata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server