Skip to main content
Glama

Market Stress Indices

query_network_stress

Assess network-level market stress across blockchains using liquidation, gas, and failure data. Returns a 0-100 composite score for macro DeFi risk analysis.

Instructions

Get network-level market stress indices combining liquidation intensity, gas costs, and execution failure rates. Provides a 0-100 composite stress score per blockchain. Useful for macro risk assessment across DeFi lending. Source: Liquidationbot real-time telemetry.

Input Schema

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

Implementation Reference

  • Registration of the 'query_network_stress' tool via server.registerTool() with its input schema (window, network) and async handler.
    server.registerTool(
      "query_network_stress",
      {
        title: "Market Stress Indices",
        description:
          "Get network-level market stress indices combining liquidation intensity, " +
          "gas costs, and execution failure rates. Provides a 0-100 composite stress " +
          "score per blockchain. Useful for macro risk assessment across DeFi lending. " +
          "Source: Liquidationbot real-time telemetry.",
        inputSchema: {
          window: z
            .enum(["1h", "24h", "7d"])
            .optional()
            .describe("Time window for aggregation (default: 1h)"),
          network: z
            .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"])
            .optional()
            .describe("Filter by blockchain network"),
        },
      },
      async ({ window, network }) => {
        const res = await apiGet<CryptoQueryResponse>(
          "/api/v1/crypto/risk/networks",
          {
            window: window ?? "1h",
            network,
          },
        );
    
        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} network stress record(s) for window=${window ?? "1h"}.`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • Async handler function that calls apiGet('/api/v1/crypto/risk/networks') with window and network params, then returns formatted text content with results or error.
    async ({ window, network }) => {
      const res = await apiGet<CryptoQueryResponse>(
        "/api/v1/crypto/risk/networks",
        {
          window: window ?? "1h",
          network,
        },
      );
    
      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} network stress 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 for query_network_stress: optional 'window' enum (1h/24h/7d) and optional 'network' enum (ethereum/arbitrum/polygon/base/bsc/avalanche).
      inputSchema: {
        window: z
          .enum(["1h", "24h", "7d"])
          .optional()
          .describe("Time window for aggregation (default: 1h)"),
        network: z
          .enum(["ethereum", "arbitrum", "polygon", "base", "bsc", "avalanche"])
          .optional()
          .describe("Filter by blockchain network"),
      },
    },
  • apiGet() helper function used by the handler to make HTTP GET requests to the Verilex API.
    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,
      };
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It mentions the data source (Liquidationbot real-time telemetry) but does not clarify whether the operation is read-only, idempotent, or any potential side effects. This lack of transparency leaves ambiguity for the agent.

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, each serving a distinct purpose: the first states the tool's action and composition, the second provides use case and source. No wasted words, efficiently communicating key information.

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?

While the description gives the core output (0-100 composite score), it lacks details on the response structure (e.g., single object or array per network). Given the optional network filter and no output schema, a bit more structure would improve completeness, but it is still functional for a simple query tool.

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 coverage is 100%, with both parameters described in the schema. The description adds a high-level understanding of the output (stress score) but does not elaborate on parameter behavior beyond the schema. Achieves baseline without enhancing.

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?

Description clearly states the tool retrieves network-level market stress indices, combining liquidation intensity, gas costs, and failure rates. It specifies the output is a 0-100 composite score per blockchain, distinguishing it from sibling tools that focus on other metrics.

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?

Explicitly says 'useful for macro risk assessment across DeFi lending,' providing a clear context. However, it does not explicitly mention when not to use or compare to alternatives like query_protocol_risk, missing some guidance for 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/carrierone/verilexdata-mcp'

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