Skip to main content
Glama

get_open_interest

Read-onlyIdempotent

Retrieve current Hyperliquid open interest for any coin, including mark price, oracle price, and 24h volume.

Instructions

Get the current Hyperliquid open interest for a coin. Returns OI, mark price, oracle price, and 24h volume.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin/market symbol, e.g. 'BTC', 'ETH', 'SOL'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:539-545 (registration)
    Registration of the 'get_open_interest' tool using registerCurrentTool helper. It takes a coin param, normalizes it, and calls api().hyperliquid.openInterest.current(coin).
    registerCurrentTool(
      "get_open_interest",
      "Get the current Hyperliquid open interest for a coin. Returns OI, mark price, oracle price, and 24h volume.",
      (coin) => api().hyperliquid.openInterest.current(coin),
      CoinParam,
      normalizeHLCoin
    );
  • The registerCurrentTool helper function serves as the generic handler. It calls the SDK's openInterest.current method with the normalized coin and wraps the result via formatResponse.
      registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => {
        const data = await sdkCall(normFn(params.coin));
        return formatResponse(data);
      });
    }
  • CoinParam is the input schema for the get_open_interest tool - a string describing the coin/market symbol (e.g. 'BTC', 'ETH', 'SOL').
    const CoinParam = z
      .string()
      .describe("Coin/market symbol, e.g. 'BTC', 'ETH', 'SOL'");
  • ObjectOutputSchema is the output schema for get_open_interest - returns a single data object.
    const ObjectOutputSchema: ZodRawShape = {
      data: z.record(z.unknown()).describe("Result data object"),
    };
  • The api() helper function returns the OxArchive SDK client instance used to call hyperliquid.openInterest.current.
    function api(): OxArchive {
      return client!;
    }
Behavior4/5

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

Annotations already indicate read-only, idempotent, and non-destructive behavior. The description adds value by specifying the exact output fields, which further clarifies the tool's behavior without contradicting 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?

The description is only two sentences, front-loaded with the core purpose, and includes essential return details. Every word is necessary and no filler.

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?

For a simple tool with one parameter and a clear output schema, the description completely covers what the tool does and what it returns. No missing information.

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?

The schema already fully describes the 'coin' parameter with examples. The description does not add any additional context or meaning beyond the schema, so it meets the baseline.

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 the current open interest for a coin and lists the specific return fields (OI, mark price, oracle price, 24h volume). This distinguishes it from sibling tools like get_open_interest_history.

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?

While the description implies it's for current data, it does not explicitly mention when to use alternatives such as get_open_interest_history or other HIP3/Lighter variants. No explicit when-not-to-use guidance.

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