Skip to main content
Glama

get_lighter_l3_orderbook_history

Read-onlyIdempotent

Access historical Lighter L3 orderbook snapshots with order-level details: order IDs, user addresses, prices, and sizes over a time range.

Instructions

Get historical Lighter L3 orderbook snapshots (Pro+ tier). Returns order-level snapshots with individual order IDs, user addresses, prices, and sizes over a time range.

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
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:977-985 (registration)
    Registration of get_lighter_l3_orderbook_history tool using the generic registerHistoryTool helper. It passes the SDK call api().lighter.l3Orderbook.history with coin normalization and an optional depth parameter.
    registerHistoryTool(
      "get_lighter_l3_orderbook_history",
      "Get historical Lighter L3 orderbook snapshots (Pro+ tier). Returns order-level snapshots with individual order IDs, user addresses, prices, and sizes over a time range.",
      (coin, params) =>
        api().lighter.l3Orderbook.history(coin, params as any),
      LighterCoinParam,
      normalizeLighterCoin,
      { depth: DepthParam }
    );
  • The registerHistoryTool helper function that builds the tool registration for history-type tools with cursor pagination. It constructs the schema (coin + HistoryParams + extra params), resolves time range, limit, cursor, and passes extra params through to the SDK call.
    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);
      });
    }
  • LighterCoinParam schema — the coin parameter used by get_lighter_l3_orderbook_history (validates coin symbol input).
    const LighterCoinParam = z
      .string()
      .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'");
  • Helper function to normalize Lighter coin symbols to uppercase.
    function normalizeLighterCoin(coin: string): string {
      return coin.toUpperCase();
    }
  • resolveLimit — default limit helper used by the history tool handler (defaults to 100).
    function resolveLimit(limit?: number): number {
      return limit ?? 100;
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds value by detailing return content (order-level snapshots with IDs, addresses) and tier requirement (Pro+). Does not mention pagination or rate limits, but these are covered by schema 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 sentences, no wasted words. First sentence states action and tier, second describes return fields. Front-loaded with key decision factors (historical, L3, Pro+).

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?

Tool has 6 params and an output schema. Description covers purpose, return content, and tier. Could mention pagination cursor or depth parameter behavior, but output schema likely covers return structure. Nearly complete.

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 has 100% description coverage. Description's 'over a time range' loosely references start/end, but adds no structural meaning beyond schema. Baseline 3 as schema carries parameter info.

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 'Get historical Lighter L3 orderbook snapshots' – specific verb, resource, and scope. It distinguishes from real-time (get_lighter_l3_orderbook) and other levels (L2, L4) by specifying L3 and historical nature. Lists returned fields (order IDs, user addresses, prices, sizes) for precision.

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?

Implied context: historical snapshots vs. current data, and Pro+ tier restriction. But no explicit when-to-use or when-not-to-use compared to siblings like get_lighter_l3_orderbook (real-time) or get_lighter_orderbook_history (likely L2). Alternatives not named.

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