Skip to main content
Glama

get_hip3_price_history

Read-onlyIdempotent

Retrieve historical mark, oracle, and mid prices for HIP-3 coins with customizable time range and aggregation intervals.

Instructions

Get mark/oracle/mid price history for a HIP-3 coin over a time range. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns mark_price, oracle_price, and mid_price at each timestamp. Supports aggregation intervals.

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
intervalNoAggregation interval: '5m', '15m', '30m', '1h', '4h', '1d'. Default '1h'

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:942-951 (registration)
    Registration of the get_hip3_price_history tool via registerHistoryTool helper. It delegates to api().hyperliquid.hip3.priceHistory() with coin normalization (case-sensitive) and supports an optional aggregation interval parameter.
    // HIP-3 Price History
    registerHistoryTool(
      "get_hip3_price_history",
      "Get mark/oracle/mid price history for a HIP-3 coin over a time range. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns mark_price, oracle_price, and mid_price at each timestamp. Supports aggregation intervals.",
      (coin, params) =>
        api().hyperliquid.hip3.priceHistory(coin, params as any),
      Hip3CoinParam,
      normalizeHip3Coin,
      { interval: z.enum(["5m", "15m", "30m", "1h", "4h", "1d"]).optional().describe("Aggregation interval: '5m', '15m', '30m', '1h', '4h', '1d'. Default '1h'") }
    );
  • Generic handler pattern used by get_hip3_price_history. Parses coin, time range, limit, cursor, and extra params (like interval), resolves time defaults, then calls the SDK's priceHistory() and formats the cursor-paginated response.
    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);
      });
    }
  • Shared HistoryParams input schema used by get_hip3_price_history: start, end, limit, 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,
    };
  • Shared ListOutputSchema output schema used by get_hip3_price_history (returns records, count, 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"),
    };
  • Helper used by the tool handler to resolve default time range (24h ago to now) and convert timestamps to Unix ms.
    function resolveTimeRange(
      start?: number | string,
      end?: number | string
    ): { start: number; end: number } {
      return {
        start: start != null ? toUnixMs(start) : Date.now() - 24 * 60 * 60 * 1000,
        end: end != null ? toUnixMs(end) : Date.now(),
      };
    }
Behavior3/5

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

Annotations already declare readOnly, destructiveHint, idempotent. The description adds that it returns mark, oracle, mid prices and supports aggregation intervals, providing some behavioral context beyond annotations, but does not cover pagination or data retention.

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?

Three concise sentences front-loaded with purpose, case-sensitivity warning, return values, and interval support. No fluff 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 output schema exists, the description covers core functionality well. Could mention pagination (cursor) and clarify difference from get_hip3_candles, but still fairly complete for a price history 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 detailed parameter descriptions (e.g., coin examples, start/end defaults, interval enum). The description adds minimal parameter-specific semantics (mentions case-sensitivity for coin but that's already in schema). 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 'Get mark/oracle/mid price history for a HIP-3 coin over a time range', specifying the verb (Get), resource (price history), scope (HIP-3 coin, time range), and return values (mark, oracle, mid price). It distinguishes from siblings like get_hip3_candles (OHLCV) by focusing on price types.

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 usage for HIP-3 price history and notes case-sensitivity, but does not explicitly state when NOT to use it (e.g., for candles use get_hip3_candles). However, the context and sibling names make differentiation possible.

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