Skip to main content
Glama

get_lighter_price_history

Read-onlyIdempotent

Retrieve historical mark, oracle, and mid prices for a Lighter.xyz coin over a specified time range with customizable aggregation intervals.

Instructions

Get mark/oracle price history for a Lighter.xyz coin over a time range. Returns mark_price, oracle_price, and mid_price at each timestamp. Supports aggregation intervals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesLighter.xyz coin symbol, e.g. 'BTC', 'ETH'
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:913-922 (registration)
    Registration of the get_lighter_price_history tool via registerHistoryTool helper. The tool is described as 'Get mark/oracle price history for a Lighter.xyz coin over a time range. Returns mark_price, oracle_price, and mid_price at each timestamp. Supports aggregation intervals.' It delegates to api().lighter.priceHistory(coin, params) with LighterCoinParam schema and normalizeLighterCoin normalization. Extra schema allows an optional aggregation interval parameter (5m, 15m, 30m, 1h, 4h, 1d).
    // Lighter Price History
    registerHistoryTool(
      "get_lighter_price_history",
      "Get mark/oracle price history for a Lighter.xyz coin over a time range. Returns mark_price, oracle_price, and mid_price at each timestamp. Supports aggregation intervals.",
      (coin, params) =>
        api().lighter.priceHistory(coin, params as any),
      LighterCoinParam,
      normalizeLighterCoin,
      { interval: z.enum(["5m", "15m", "30m", "1h", "4h", "1d"]).optional().describe("Aggregation interval: '5m', '15m', '30m', '1h', '4h', '1d'. Default '1h'") }
    );
  • The LighterCoinParam Zod schema defines the input validation for the coin parameter used by get_lighter_price_history. It's a string describing a Lighter.xyz coin symbol (e.g., 'BTC', 'ETH').
    const LighterCoinParam = z
      .string()
      .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'");
  • The normalizeLighterCoin helper normalizes the coin symbol to uppercase before passing it to the SDK call.
    function normalizeLighterCoin(coin: string): string {
      return coin.toUpperCase();
    }
  • The registerHistoryTool helper function (Pattern 4) that handles tool registration for get_lighter_price_history. It constructs the input schema (coin + HistoryParams + extraSchema), resolves time ranges, handles cursor pagination, passes extra params through, and calls the provided SDK function.
    // 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);
      });
    }
Behavior3/5

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

Annotations already declare read-only and idempotent behavior. The description adds that it returns specific price types and supports intervals, but does not disclose additional behavioral traits like pagination limits or data freshness.

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 two sentences, front-loaded with purpose, and every sentence adds value. No unnecessary 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?

Given the tool's simplicity, annotations, and schema coverage, the description adequately covers the tool's purpose and key features. However, it could mention that it's for Lighter.xyz specifically to distinguish from siblings, but the name implies that.

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%, so baseline is 3. The description adds context beyond schema names by specifying return fields and interval support, enhancing understanding.

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 retrieves mark/oracle price history for a specific platform (Lighter.xyz), specifies the returned fields, and mentions aggregation intervals. This distinguishes it from general price history tools.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool compared to similar tools like get_price_history or get_hip3_price_history. The context signal includes many siblings, but the description does not differentiate usage scenarios.

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