Skip to main content
Glama

get_instrument

Read-onlyIdempotent

Retrieve details for a Hyperliquid instrument by coin symbol, including leverage, decimals, and active status.

Instructions

Get details for a single Hyperliquid instrument by coin symbol. Returns leverage, decimals, and active status.

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:470-476 (registration)
    Registration of the 'get_instrument' tool via registerCurrentTool helper, using CoinParam schema and normalizeHLCoin normalization.
    registerCurrentTool(
      "get_instrument",
      "Get details for a single Hyperliquid instrument by coin symbol. Returns leverage, decimals, and active status.",
      (coin) => api().hyperliquid.instruments.get(coin),
      CoinParam,
      normalizeHLCoin
    );
  • The registerCurrentTool helper function generates the actual handler for 'get_instrument'. It accepts a coin parameter, normalizes it via normFn (normalizeHLCoin), calls the SDK's hyperliquid.instruments.get method, 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);
      });
  • Input schema (CoinParam) used by 'get_instrument' — a simple string describing the coin symbol.
    const CoinParam = z
      .string()
      .describe("Coin/market symbol, e.g. 'BTC', 'ETH', 'SOL'");
  • Output schema (ObjectOutputSchema) used by 'get_instrument' — wraps the response in a data object.
    const ObjectOutputSchema: ZodRawShape = {
      data: z.record(z.unknown()).describe("Result data object"),
    };
  • Normalization helper that uppercases the coin symbol before passing to the SDK.
    function normalizeHLCoin(coin: string): string {
      return coin.toUpperCase();
    }
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. The description adds behavioral context by listing returned fields (leverage, decimals, active status) and confirms a read operation, providing value beyond 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 a single, well-structured sentence with no extraneous text. It front-loads the core action and resource, making it efficient for an agent to parse.

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, single-parameter tool with full annotations and an output schema, the description is sufficient. It clearly states the purpose and key return fields, filling the gaps without over explaining.

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% with a clear parameter description. The description's 'by coin symbol' adds no new meaning beyond what the schema provides. 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 verb 'Get details' and specific resource 'single Hyperliquid instrument by coin symbol', with return fields listed. It effectively differentiates from sibling `get_instruments` (plural) and other instrument tools by specifying singularity and coin symbol input.

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?

The description implies use for a single instrument but lacks explicit guidance on when to select this tool over alternatives like `get_hip3_instrument` or `get_instruments`. No when-not-to-use or alternative naming provided.

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