Skip to main content
Glama

get_hip3_orderbook_history

Read-onlyIdempotent

Get historical HIP-3 orderbook L2 snapshots with bids and asks for a coin symbol over a time range. Supports pagination and depth control.

Instructions

Get historical HIP-3 orderbook snapshots. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns L2 snapshots with bids/asks over a time range. Free tier: km:US500 only. Build+: all HIP-3 symbols.

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
depthNoOrderbook depth — number of price levels per side

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:661-670 (registration)
    Tool 'get_hip3_orderbook_history' is registered using the registerHistoryTool helper. It uses the HIP-3 coin param schema (case-sensitive), the normalizeHip3Coin normalization function, and calls api().hyperliquid.hip3.orderbook.history(coin, params) via the 0xArchive SDK. It also includes an optional depth parameter.
    // HIP-3 Orderbook History
    registerHistoryTool(
      "get_hip3_orderbook_history",
      "Get historical HIP-3 orderbook snapshots. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns L2 snapshots with bids/asks over a time range. Free tier: km:US500 only. Build+: all HIP-3 symbols.",
      (coin, params) =>
        api().hyperliquid.hip3.orderbook.history(coin, params as any),
      Hip3CoinParam,
      normalizeHip3Coin,
      { depth: DepthParam }
    );
  • The registerHistoryTool helper function generates the actual handler logic. It builds time-range parameters (start/end with defaults of 24h ago / now), passes limit, cursor, and any extra params (like depth) to the SDK call, then formats the response with cursor-based pagination.
    // 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 schema validates HIP-3 coin symbols (case-sensitive, e.g. 'km:US500', 'xyz:GOLD').
    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 ensures HIP-3 coin symbols are passed through without transformation (case-sensitive).
    function normalizeHip3Coin(coin: string): string {
      return coin; // Case-sensitive
    }
  • The HistoryParams schema defines the shared input parameters for history tools: start, end, limit, and cursor.
    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 mark the tool as readOnly, idempotent, and non-destructive. The description adds value by stating the return format ('bids/asks over a time range') and data tier access restrictions, which are not in annotations. No contradictions detected. However, it does not disclose potential rate limits or response size limits beyond the 'limit' parameter.

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 consists of three short, focused sentences. The first sentence states the core purpose, the second adds case-sensitivity, and the third clarifies tier restrictions. Every sentence adds necessary information, no fluff or repetition.

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 the tool's moderate complexity (6 parameters, output schema present), the description provides sufficient context: what data is returned (L2 snapshots), how to handle case-sensitivity, and tier limitations. Pagination is implied via cursor parameter, and the output schema covers return structure. No further details are needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with each parameter described. The description compensates by adding context about the free tier limitation (only km:US500 without Build+ subscription) and emphasizing case-sensitivity for the 'coin' parameter. These details are beyond what the schema provides, raising the baseline from 3 to 4.

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 it retrieves 'historical HIP-3 orderbook snapshots' with L2 bids/asks over a time range. This distinguishes it from sibling tools like get_hip3_orderbook (current snapshot) and get_hip3_l2_orderbook_history (which is similarly named but likely a duplicate or variant). The verb 'Get' and resource 'history' match the name perfectly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions case-sensitivity and a free tier limitation ('Free tier: km:US500 only'). However, it does not explicitly differentiate this tool from closely related siblings like get_hip3_l2_orderbook_history or get_hip3_l4_orderbook_history. No guidance on when to choose this over those alternatives, lacking explicit 'use when' or 'use instead' statements.

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