Skip to main content
Glama

get_spot_orderbook

Read-onlyIdempotent

Get the current Hyperliquid Spot L2 orderbook snapshot for a pair, returning bids, asks, mid price, and spread. Optionally set depth per side.

Instructions

Get the current Hyperliquid Spot L2 orderbook snapshot for a pair. Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns bids, asks, mid price, and spread. Optionally specify depth (price levels per side). Live from 2026-05-05. Pro+ tier required for full depth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesHyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all.
depthNoOrderbook depth — number of price levels per side

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:1332-1338 (registration)
    Registration of the 'get_spot_orderbook' tool using the registerOrderbookTool helper. Passes the coin to api().spot.orderbook.get() with optional depth. Uses SpotCoinParam schema and normalizeSpotCoin normalizer.
    registerOrderbookTool(
      "get_spot_orderbook",
      "Get the current Hyperliquid Spot L2 orderbook snapshot for a pair. Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns bids, asks, mid price, and spread. Optionally specify depth (price levels per side). Live from 2026-05-05. Pro+ tier required for full depth.",
      (coin, params) => api().spot.orderbook.get(coin, params),
      SpotCoinParam,
      normalizeSpotCoin
    );
  • Input schema for the coin parameter, which accepts dashed canonical spot pair symbols like 'HYPE-USDC'.
    const SpotCoinParam = z
      .string()
      .describe(
        "Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all."
      );
  • Input schema for the optional depth parameter (number of price levels per side).
    const DepthParam = z
      .number()
      .optional()
      .describe("Orderbook depth — number of price levels per side");
  • Helper function that handles the common pattern for registering an orderbook tool. Normalizes the coin, passes optional depth to the SDK call, and wraps the response via formatResponse.
    function registerOrderbookTool(
      name: string,
      description: string,
      sdkCall: (coin: string, params?: { depth?: number }) => Promise<unknown>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string
    ): void {
      registerTool(
        name,
        description,
        { coin: coinSchema, depth: DepthParam },
        ObjectOutputSchema,
        async (params) => {
          const sdkParams = params.depth ? { depth: params.depth } : undefined;
          const data = await sdkCall(normFn(params.coin), sdkParams);
          return formatResponse(data);
        }
      );
    }
  • Normalization helper that uppercases the spot coin symbol before passing it to the SDK.
    function normalizeSpotCoin(coin: string): string {
      return coin.toUpperCase();
    }
Behavior4/5

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

Annotations already indicate read-only, idempotent, open world. Description adds valuable context beyond annotations: the live date (2026-05-05) and the Pro+ tier requirement for full depth, which are important behavioral details.

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?

Description is four sentences, front-loading the core purpose in the first sentence, then efficiently covering returns, optional parameter, and access requirement. No unnecessary words.

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?

With an output schema present, the description adequately covers the tool's purpose, return values, and key constraints (depth optional, tier requirement). No gaps given the simplicity of the 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%, so baseline is 3. Description reiterates symbol format and depth description, adding no new meaning beyond the schema's parameter descriptions.

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?

Description explicitly states it retrieves the current Hyperliquid Spot L2 orderbook snapshot for a pair, specifies symbol format, and lists returned data (bids, asks, mid price, spread). This clearly differentiates it from siblings like get_spot_orderbook_history or get_l2_orderbook.

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?

Description mentions optional depth and a Pro+ tier requirement for full depth, giving some context on when to use, but does not explicitly compare or contrast with siblings or state when not to use this tool.

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