Skip to main content
Glama

get_hip3_open_interest

Read-onlyIdempotent

Get the current HIP-3 open interest for a coin, along with mark price and oracle price. Use the case-sensitive symbol (e.g., 'km:US500').

Instructions

Get the current HIP-3 open interest for a coin. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns OI, mark price, and oracle price.

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:730-737 (registration)
    Registration of the get_hip3_open_interest tool via registerCurrentTool helper, which sets up name, description, input schema (Hip3CoinParam), output schema (ObjectOutputSchema), and handler that calls api().hyperliquid.hip3.openInterest.current(coin).
    // 21. HIP-3 Open Interest Current
    registerCurrentTool(
      "get_hip3_open_interest",
      "Get the current HIP-3 open interest for a coin. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns OI, mark price, and oracle price.",
      (coin) => api().hyperliquid.hip3.openInterest.current(coin),
      Hip3CoinParam,
      normalizeHip3Coin
    );
  • Input schema (Hip3CoinParam) used by the tool — a case-sensitive string parameter for HIP-3 coin symbols.
    const Hip3CoinParam = z
      .string()
      .describe(
        "HIP-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."
      );
  • Generic registerTool helper that wraps tool registration with API key guard and error handling.
    function registerTool(
      name: string,
      description: string,
      inputSchema: ZodRawShape,
      outputSchema: ZodRawShape,
      handler: (params: any) => Promise<McpContent>
    ): void {
      server.registerTool(
        name,
        {
          description,
          inputSchema,
          outputSchema,
          annotations: TOOL_ANNOTATIONS,
        },
        async (params: any) => {
          if (!client) {
            return {
              content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }],
              isError: true,
            };
          }
          try {
            return await handler(params);
          } catch (err) {
            const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
            return formatError(error);
          }
        }
      );
    }
  • registerCurrentTool helper pattern used to register get_hip3_open_interest — takes a coin parameter, normalizes it, calls the SDK, and formats the response.
    // Pattern 2: Current snapshot (coin only)
    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);
      });
    }
  • Normalization helper for HIP-3 coins (pass-through since HIP-3 symbols are case-sensitive).
    function normalizeHip3Coin(coin: string): string {
      return coin; // Case-sensitive
    }
Behavior4/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true, so the tool is safe. The description adds that it returns current data with specific fields (OI, mark price, oracle price). No annotation contradiction.

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: first states the core purpose, second covers case-sensitivity and return fields. No wasted words, information is front-loaded.

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 one-parameter read tool with output schema, the description covers purpose, usage guidance, returned fields, and symbol format. Annotations provide safety and idempotency. Nothing missing.

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 input schema already fully describes the 'coin' parameter with examples and instructions (100% coverage). The description repeats the case-sensitivity hint but adds no new meaning beyond the 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 the tool gets current HIP-3 open interest for a coin. It specifies case-sensitivity and lists returned fields (OI, mark price, oracle price). This distinguishes it from siblings like get_hip3_open_interest_history (historical) and get_hip4_open_interest (different protocol).

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 emphasizes case-sensitive symbols and provides examples across builders. It explicitly directs to use get_hip3_instruments for listing available instruments. While it doesn't state when not to use this tool, the context is clear for a simple read operation.

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