Skip to main content
Glama
Coinversaa

Coinversaa Pulse

Official

live_long_short_ratio

Retrieve long/short ratio for Hyperliquid. Get global ratio or per-coin pair ratio, with optional historical data up to 7 days.

Instructions

Get long/short ratio data. Without a coin, returns the global ratio across all Hyperliquid. With a coin, returns that specific pair's ratio. Optionally include historical data over the last N hours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
useToonFormatNoReturn data in compact toon format (default: true). Set to false for standard JSON.
coinNoCoin symbol (e.g. BTC, ETH). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global ratio.
hoursNoInclude historical data for the last N hours (max 168 = 7 days)

Implementation Reference

  • src/index.ts:30-38 (registration)
    The tool name 'live_long_short_ratio' is listed in the FREE_TIER_TOOLS set, marking it as a free tier tool available without an API key.
    const FREE_TIER_TOOLS = new Set([
      'pulse_global_stats',
      'pulse_market_overview',
      'list_markets',
      'market_price',
      'market_orderbook',
      'pulse_most_traded_coins',
      'live_long_short_ratio',
    ]);
  • The main handler for the 'live_long_short_ratio' tool. It registers the tool with server.registerTool, defines the input schema (useToonFormat, optional coin, optional hours), and the async handler function. The handler has three modes: 1) if 'hours' is provided, calls /live/long-short/history for historical data; 2) if 'coin' is provided (without hours), calls /live/coins/{coin}/long-short for per-coin ratio; 3) otherwise calls /live/long-short for the global ratio.
    // TOOL 20: Long/Short Ratio                         [FREE]
    // ══════════════════════════════════════════════════════════
    if (shouldRegister("live_long_short_ratio")) server.registerTool(
      "live_long_short_ratio",
      {
        description: "Get long/short ratio data. Without a coin, returns the global ratio across all Hyperliquid. With a coin, returns that specific pair's ratio. Optionally include historical data over the last N hours.",
        inputSchema: {
          useToonFormat: useToonFormatSchema,
          coin: z.string().optional().describe("Coin symbol (e.g. BTC, ETH). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global ratio."),
          hours: z.number().min(1).max(168).optional().describe("Include historical data for the last N hours (max 168 = 7 days)"),
        },
      },
      async ({ useToonFormat, coin, hours }) => {
        if (hours) {
          // Historical mode
          const params: Record<string, string> = { hours: String(hours) };
          if (coin) params.coin = normalizeCoin(coin);
          return toolResult(await callAPI(useToonFormat, "/live/long-short/history", params));
        }
        if (coin) {
          return toolResult(await callAPI(useToonFormat, `/live/coins/${normalizeCoin(coin)}/long-short`));
        }
        return toolResult(await callAPI(useToonFormat, "/live/long-short"));
      }
    );
  • Input schema for the live_long_short_ratio tool. Accepts an optional 'coin' symbol (string) and an optional 'hours' parameter (1-168) to include historical data.
      description: "Get long/short ratio data. Without a coin, returns the global ratio across all Hyperliquid. With a coin, returns that specific pair's ratio. Optionally include historical data over the last N hours.",
      inputSchema: {
        useToonFormat: useToonFormatSchema,
        coin: z.string().optional().describe("Coin symbol (e.g. BTC, ETH). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global ratio."),
        hours: z.number().min(1).max(168).optional().describe("Include historical data for the last N hours (max 168 = 7 days)"),
      },
    },
  • src/index.ts:19-28 (registration)
    Duplicate registration entry for 'live_long_short_ratio' in the built/compiled index.js FREE_TIER_TOOLS set.
    const API_URL = process.env.COINVERSAA_API_URL || "https://api.coinversa.ai";
    const BASE = `${API_URL}/api/public/v1`;
    const REQUEST_TIMEOUT_MS = 30_000;
    const MAX_RETRIES = 2;
    const RETRY_DELAY_MS = 1_000;
    
    // Free tier tools — available without an API key (IP-rate-limited on the backend).
    // Must match prod's FREE_TIER_ROUTES allowlist in apiKeyAuth.ts — any mismatch
    // means users hit 401s on tools the MCP advertises as keyless.
    // The cross-market asset tools (list_assets, list_asset, pulse_cross_market_asset)
  • Compiled handler for the 'live_long_short_ratio' tool in build/index.js, identical logic to the source.
    if (shouldRegister("pulse_recent_trades")) server.registerTool(
      "pulse_recent_trades",
      {
        description: "Get the biggest trades on Hyperliquid in the last N minutes/hours. Returns trades sorted by absolute PnL — the largest movers. Use this to see what's happening right now on the exchange.",
        inputSchema: {
          useToonFormat: useToonFormatSchema,
          since: sinceSchema.default("10m"),
          limit: z.number().min(1).max(100).default(20).describe("Number of trades to return"),
          coin: z.string().optional().describe("Filter by coin symbol (e.g. BTC, ETH, SOL). For builder dex: prefix:COIN (e.g. xyz:SILVER)"),
        },
      },
      async ({ useToonFormat, since, limit, coin }) => {
        const params: Record<string, string> = { since, limit: String(limit) };
        if (coin) params.coin = normalizeCoin(coin);
        return toolResult(await callAPI(useToonFormat, "/pulse/trades/recent", params));
      }
    );
    
    // ══════════════════════════════════════════════════════════
    // TOOL 12: Trader Recent Trades
    // ══════════════════════════════════════════════════════════
    if (shouldRegister("pulse_trader_trades")) server.registerTool(
      "pulse_trader_trades",
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states the basic behavior (returns global or per-coin ratio) and optional historical data, but lacks details on data recency, caching, or potential side effects. Adequate but not comprehensive.

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, front-loaded with the action ('Get long/short ratio data'), and efficiently covers all key points without redundancy.

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?

The tool has no output schema, so the description should cover output format. It mentions the 'useToonFormat' parameter but does not describe the returned data structure. However, the core functionality (global vs per-coin, historical) is well explained, leaving only minor ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, baseline is 3. The description adds value by explaining the business logic: coin absence means global ratio, and hours enables historical data. This clarifies the parameters' roles beyond the schema definitions.

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's purpose: 'Get long/short ratio data.' It distinguishes between global (without coin) and per-coin (with coin) modes, and mentions optional historical data. This differentiates it from siblings like 'live_cohort_bias' or 'live_liquidation_heatmap'.

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 provides clear usage context: omit coin for global ratio, specify coin for a pair, and optionally include hours for history. It does not explicitly mention when not to use or compare to alternatives, but the guidance is sufficiently direct.

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/Coinversaa/mcp-server'

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