Skip to main content
Glama

get_liquidations

Read-onlyIdempotent

Retrieve Hyperliquid liquidation history for a coin, including liquidator addresses, price, size, side, and PnL over a specified time range.

Instructions

Get Hyperliquid liquidation history for a coin over a time range. Returns liquidated/liquidator addresses, price, size, side, and PnL. Data available from May 2025. Real-time liquidations are also available on the WebSocket liquidations channel — each event is a fill row with is_liquidation: true, same shape as the trades channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin/market symbol, e.g. 'BTC', 'ETH', 'SOL'
startNoStart timestamp (Unix ms or ISO). Defaults to 24h ago.
endNoEnd timestamp (Unix ms or ISO). Defaults to now.
limitNoMax records to return (default 100, max 1000)
cursorNoPagination cursor from previous response's nextCursor

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordsYesArray of result records
countYesTotal number of records in the full result set
nextCursorNoCursor for next page, if more results available

Implementation Reference

  • src/index.ts:558-566 (registration)
    Registration of the 'get_liquidations' tool using the registerHistoryTool helper pattern. It is a Hyperliquid liquidation history tool for a coin over a time range, delegating to api().hyperliquid.liquidations.history().
    // 10. Liquidations
    registerHistoryTool(
      "get_liquidations",
      "Get Hyperliquid liquidation history for a coin over a time range. Returns liquidated/liquidator addresses, price, size, side, and PnL. Data available from May 2025. Real-time liquidations are also available on the WebSocket `liquidations` channel — each event is a fill row with `is_liquidation: true`, same shape as the `trades` channel.",
      (coin, params) =>
        api().hyperliquid.liquidations.history(coin, params as any),
      CoinParam,
      normalizeHLCoin
    );
  • The registerHistoryTool helper that acts as the actual handler for 'get_liquidations'. It creates the handler function that resolves time range, limit, cursor, and calls the SDK method (in this case api().hyperliquid.liquidations.history()), then formats the cursor-paginated response.
    // Pattern 4: History with cursor pagination (coin + time range)
    function registerHistoryTool(
      name: string,
      description: string,
      sdkCall: (coin: string, params: Record<string, unknown>) => Promise<{ data: unknown; nextCursor?: string }>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string,
      extraSchema?: ZodRawShape
    ): void {
      const schema: ZodRawShape = { coin: coinSchema, ...HistoryParams };
      if (extraSchema) Object.assign(schema, extraSchema);
    
      registerTool(name, description, schema, ListOutputSchema, async (params) => {
        const { coin, start, end, limit, cursor, ...extra } = params;
    
        const timeRange = resolveTimeRange(start, end);
        const sdkParams: Record<string, unknown> = {
          ...timeRange,
          limit: resolveLimit(limit),
        };
    
        if (cursor) sdkParams.cursor = cursor;
    
        // Pass through extra params (interval, side, etc.)
        for (const [k, v] of Object.entries(extra)) {
          if (v !== undefined) sdkParams[k] = v;
        }
    
        const result = await sdkCall(normFn(coin), sdkParams);
        return formatCursorResponse(result);
      });
    }
  • The input schema used by registerHistoryTool — defines start (timestamp), end (timestamp), limit (number), and cursor (string) parameters used by get_liquidations.
    const HistoryParams = {
      start: TimestampParam.describe(
        "Start timestamp (Unix ms or ISO). Defaults to 24h ago."
      ),
      end: TimestampParam.describe(
        "End timestamp (Unix ms or ISO). Defaults to now."
      ),
      limit: LimitParam,
      cursor: CursorParam,
    };
  • The output schema (ListOutputSchema) used by get_liquidations — returns records array, count, and optional nextCursor.
    const ListOutputSchema: ZodRawShape = {
      records: z.array(z.record(z.unknown())).describe("Array of result records"),
      count: z.number().describe("Total number of records in the full result set"),
      nextCursor: z
        .string()
        .optional()
        .describe("Cursor for next page, if more results available"),
    };
  • The registerTool helper function that registerHistoryTool builds upon. It wraps the handler with API key validation and error formatting.
    function registerTool(
      name: string,
      description: string,
      inputSchema: ZodRawShape,
      outputSchema: ZodRawShape,
      handler: (params: any) => Promise<McpContent>
    ): void {
      server.registerTool(
        name,
        {
          description,
          inputSchema,
          outputSchema,
          annotations: TOOL_ANNOTATIONS,
        },
        async (params: any) => {
          if (!client) {
            return {
              content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }],
              isError: true,
            };
          }
          try {
            return await handler(params);
          } catch (err) {
            const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
            return formatError(error);
          }
        }
      );
    }
Behavior4/5

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

Annotations already indicate readOnly, destructive, idempotent, and openWorld hints. The description adds useful context: returned fields (addresses, price, size, side, PnL), data availability from May 2025, and WebSocket alternative. No contradictions, and adds value beyond annotations.

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 three concise sentences: first states purpose and output, second notes data availability, third mentions WebSocket alternative. Front-loaded and no wasted words.

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?

With an output schema present, the description doesn't need to detail return structure. It covers key fields, data availability, and a real-time alternative. However, it could explicitly differentiate from get_liquidations_by_user for 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?

Input schema covers all 5 parameters with descriptions, so schema_description_coverage is 100%. The tool description does not add parameter-level details. It lists return fields but not parameter specifics. Baseline 3 is appropriate.

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 gets liquidation history for a specific coin over a time range. It distinguishes itself from sibling tools like get_liquidations_by_user (by user) and get_liquidation_volume, and mentions WebSocket for real-time data.

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 historical use and contrasts with real-time WebSocket. However, it does not explicitly state when to use this tool over siblings like get_liquidations_by_user or get_liquidation_volume. It provides clear context for the main use case.

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/0xArchiveIO/0xarchive-mcp'

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