Skip to main content
Glama

get_lighter_open_interest

Read-onlyIdempotent

Retrieve current open interest for a coin on Lighter.xyz. Returns OI, mark price, and oracle price given a coin symbol.

Instructions

Get the current Lighter.xyz open interest for a coin. Returns OI, mark price, and oracle price.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesLighter.xyz coin symbol, e.g. 'BTC', 'ETH'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:876-882 (registration)
    Registration of the 'get_lighter_open_interest' tool using registerCurrentTool helper, which delegates to api().lighter.openInterest.current(coin) with LighterCoinParam and normalizeLighterCoin.
    registerCurrentTool(
      "get_lighter_open_interest",
      "Get the current Lighter.xyz open interest for a coin. Returns OI, mark price, and oracle price.",
      (coin) => api().lighter.openInterest.current(coin),
      LighterCoinParam,
      normalizeLighterCoin
    );
  • The registerCurrentTool helper function that acts as the actual handler for 'get_lighter_open_interest'. It calls the SDK's openInterest.current() method with the normalized coin symbol and formats the response.
    function registerCurrentTool(
      name: string,
      description: string,
      sdkCall: (coin: string) => Promise<unknown>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string
    ): void {
      registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => {
        const data = await sdkCall(normFn(params.coin));
        return formatResponse(data);
      });
    }
  • The LighterCoinParam Zod schema used as input validation for the coin parameter.
    const LighterCoinParam = z
      .string()
      .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'");
  • The ObjectOutputSchema used as output schema for this current-snapshot tool.
    const ObjectOutputSchema: ZodRawShape = {
      data: z.record(z.unknown()).describe("Result data object"),
    };
  • The normalizeLighterCoin helper function that uppercases the coin symbol before passing to the SDK.
    function normalizeLighterCoin(coin: string): string {
      return coin.toUpperCase();
    }
Behavior3/5

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

Annotations (readOnlyHint=true, destructiveHint=false, idempotentHint=true) already indicate safe, idempotent read. Description adds that it returns OI, mark price, and oracle price, which provides additional behavioral context beyond annotations. No contradictions.

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?

Single sentence that is front-loaded with the action and results. No wasted words; every element contributes to understanding.

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 presence of an output schema and clear annotations, the description adequately specifies the tool's purpose and return fields. Some minor guidance on when to choose this over sibling OI tools would improve completeness, but it is sufficient for a simple read 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% and includes a clear description for the single parameter 'coin' with examples. The description does not add additional semantic value beyond what the schema already provides.

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 current Lighter.xyz open interest for a coin and specifies the returned fields (OI, mark price, oracle price). This distinguishes it from history tools and other platform-specific OI tools among siblings.

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 guidance on when to use this tool versus alternatives like get_lighter_open_interest_history, get_open_interest, or platform-specific OI tools. The description implicitly limits to current data but does not explicitly state exclusions or comparative usage.

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