Skip to main content
Glama
VENTURE-AI-LABS

CryptoDataAPI MCP Server

get_open_interest

Retrieve cross-exchange open interest data for perpetual futures contracts to analyze market positioning and trend strength through OI changes and price movements.

Instructions

Get cross-exchange open interest data. Open interest is the total value of outstanding perpetual futures contracts. Rising OI with rising price = new money entering (trend continuation). Rising OI with falling price = new shorts opening (bearish). Falling OI = positions closing (deleveraging). Returns per-exchange OI in USD with 24h change percentages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeNoFilter by exchange name (e.g., 'binance', 'hyperliquid'). Omit for all exchanges.
typeNoMarket type filter (e.g., 'perps'). Omit for default.
limitNoNumber of results to return. Default 250.

Implementation Reference

  • The handler function for 'get_open_interest' tool which calls the API.
    export async function handler(args: z.infer<typeof schema>) {
      return apiGet("/api/v1/market-intelligence/open-interest", {
        exchange: args.exchange,
        type: args.type,
        limit: args.limit,
      });
    }
  • Input schema definition for the 'get_open_interest' tool.
    export const schema = z.object({
      exchange: z
        .string()
        .optional()
        .describe("Filter by exchange name (e.g., 'binance', 'hyperliquid'). Omit for all exchanges."),
      type: z
        .string()
        .optional()
        .describe("Market type filter (e.g., 'perps'). Omit for default."),
      limit: z
        .number()
        .optional()
        .describe("Number of results to return. Default 250."),
    });
  • src/index.ts:55-79 (registration)
    Registration loop that registers all imported tools, including 'get_open_interest', to the McpServer instance.
    for (const tool of tools) {
      server.tool(tool.name, tool.description, tool.schema.shape, async (args: Record<string, unknown>) => {
        const result = await tool.handler(args as any);
        if (result.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(result.data, null, 2),
              },
            ],
          };
        } else {
          return {
            content: [
              {
                type: "text" as const,
                text: `API Error (${result.status}): ${result.error}`,
              },
            ],
            isError: true,
          };
        }
      });
    }

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/VENTURE-AI-LABS/cryptodataapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server