Skip to main content
Glama

get_spot_l4_orderbook_history

Read-onlyIdempotent

Retrieve periodic full order-level orderbook snapshots for a Hyperliquid Spot symbol over a time range to reconstruct the L4 orderbook history.

Instructions

Get Hyperliquid Spot L4 orderbook checkpoints (Build+ tier). Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns periodic full order-level orderbook snapshots over a time range for reconstruction. Live from 2026-05-05.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesHyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all.
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:1427-1435 (registration)
    Registration of the 'get_spot_l4_orderbook_history' tool using registerHistoryTool, which calls api().spot.l4Orderbook.history(coin, params).
    // Spot L4 Orderbook History / Checkpoints (Build+)
    registerHistoryTool(
      "get_spot_l4_orderbook_history",
      "Get Hyperliquid Spot L4 orderbook checkpoints (Build+ tier). Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns periodic full order-level orderbook snapshots over a time range for reconstruction. Live from 2026-05-05.",
      (coin, params) =>
        api().spot.l4Orderbook.history(coin, params as any),
      SpotCoinParam,
      normalizeSpotCoin
    );
  • SpotCoinParam schema — validates the coin parameter for spot tools (dashed canonical pair symbols like 'HYPE-USDC').
    const SpotCoinParam = z
      .string()
      .describe(
        "Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all."
      );
  • normalizeSpotCoin helper — uppercase normalization for spot coin symbols.
    function normalizeSpotCoin(coin: string): string {
      return coin.toUpperCase();
    }
  • registerHistoryTool — the generic registration helper that sets up cursor-paginated history tools with coin, time range, limit, cursor, and extra params. This is what get_spot_l4_orderbook_history uses.
    // 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);
      });
    }
  • formatCursorResponse — formats paginated cursor responses, used by registerHistoryTool handler.
    function formatCursorResponse(result: {
      data: unknown;
      nextCursor?: string;
    }): McpContent {
      return formatResponse(result.data, {
        nextCursor: result.nextCursor,
        paginated: true,
      });
    }
Behavior5/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. Description adds context: returns periodic full order-level snapshots for reconstruction, and live data availability from a specific date. No contradictions.

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, no filler. First sentence states core purpose and tier, second explains behavior and data recency. Every phrase is meaningful.

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

Completeness5/5

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

Given output schema exists and annotations are rich, description covers essential behavioral traits (snapshots, time range, live start date) without needing to detail return values. Complete for agent decision-making.

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 has 100% description coverage. Description does not add parameter-specific details beyond what's in schema, though it reinforces the symbol format. 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?

Description clearly states verb ('Get'), resource ('Hyperliquid Spot L4 orderbook checkpoints'), and scope (Build+ tier, dashed canonical symbols). Distinguishes from siblings by specifying spot and L4, and notes live data start date.

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?

Implies usage for L4 orderbook reconstruction over a time range with Build+ tier. Does not explicitly list alternatives or when-not-to-use, but the specificity to spot L4 helps differentiate from non-spot L4 history tools present in siblings.

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