Skip to main content
Glama

get_hip3_l4_orderbook_history

Read-onlyIdempotent

Retrieve periodic HIP-3 L4 orderbook snapshots for case-sensitive coin symbols across multiple builders. Access full order-level checkpoints for historical analysis.

Instructions

Get HIP-3 L4 orderbook checkpoints (Pro+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns periodic full order-level orderbook snapshots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesHIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments 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:1250-1258 (registration)
    Registration of the 'get_hip3_l4_orderbook_history' tool using the registerHistoryTool helper pattern. It registers the tool with the description 'Get HIP-3 L4 orderbook checkpoints (Pro+ tier)...' and delegates to the SDK method api().hyperliquid.hip3.l4Orderbook.history(coin, params).
    // HIP-3 L4 Orderbook History (Checkpoints)
    registerHistoryTool(
      "get_hip3_l4_orderbook_history",
      "Get HIP-3 L4 orderbook checkpoints (Pro+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns periodic full order-level orderbook snapshots.",
      (coin, params) =>
        api().hyperliquid.hip3.l4Orderbook.history(coin, params as any),
      Hip3CoinParam,
      normalizeHip3Coin
    );
  • The registerHistoryTool helper function that acts as the actual handler for this tool. It resolves the coin symbol using normalizeHip3Coin, computes time range with resolveTimeRange, builds SDK params (start, end, limit, cursor, plus any extras like depth), calls the provided SDK callback, and formats the result with formatCursorResponse.
    // 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 Hip3CoinParam Zod schema used as the input coin parameter. It describes HIP-3 coin symbols as CASE-SENSITIVE (e.g. 'km:US500').
    const Hip3CoinParam = z
      .string()
      .describe(
        "HIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments to list all."
      );
  • The normalizeHip3Coin helper function that normalizes HIP-3 coin symbols (case-sensitive, passthrough).
    function normalizeHip3Coin(coin: string): string {
      return coin; // Case-sensitive
    }
  • The HistoryParams shared schema defining the start, end, limit, and cursor parameters used by the history tool.
    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,
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds that tool returns periodic full order-level snapshots and notes case sensitivity. Does not contradict 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?

Two concise sentences front-loading key information: purpose, tier, case sensitivity, and return type. No unnecessary words or repetition.

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?

Given full schema coverage, annotations covering safety, and presence of an output schema, the description is complete enough for a read-only historical query tool. Mentions the Pro+ tier requirement and case sensitivity, which are critical for correct invocation.

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 for all 5 parameters. Description adds no additional parameter information beyond what schema provides, so baseline score of 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?

Clearly states the tool retrieves HIP-3 L4 orderbook checkpoints, specifies it's Pro+ tier, and mentions case sensitivity. Distinguishes from siblings like get_hip3_l4_orderbook (current snapshot) and get_hip3_l4_diffs (diffs) by emphasizing historical snapshots.

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?

Indicates usage for historical orderbook snapshots, implying not for real-time current book (use get_hip3_l4_orderbook). Mentions Pro+ tier and provides example symbol. Could be more explicit about when not to use, but adequate for basic guidance.

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