Skip to main content
Glama
Liquidiction

Liquidiction

get_open_orders

Retrieve all open orders for any user wallet address on Hyperliquid prediction markets.

Instructions

Get open orders for a user address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesUser wallet address

Implementation Reference

  • mcp-server.ts:199-218 (registration)
    Registration of the 'get_open_orders' tool with the MCP server, using server.tool() and providing the name, description, input schema, and handler.
    // --- get_open_orders ---
    server.tool(
      'get_open_orders',
      'Get open orders for a user address',
      { address: z.string().describe('User wallet address') },
      async ({ address }) => {
        const orders = await hlInfo<OpenOrder[]>({ type: 'openOrders', user: address });
        const outcomeOrders = orders.filter(o => o.coin.startsWith('#'));
    
        if (outcomeOrders.length === 0) {
          return { content: [{ type: 'text', text: 'No open outcome orders.' }] };
        }
    
        const lines = outcomeOrders.map(o => {
          return `${o.side.toUpperCase()} ${o.coin} ${o.sz} @ ${(parseFloat(o.limitPx) * 100).toFixed(1)}% (oid: ${o.oid})`;
        });
    
        return { content: [{ type: 'text', text: lines.join('\n') }] };
      },
    );
  • Input schema for the 'get_open_orders' tool: requires a single 'address' string parameter (user wallet address).
    { address: z.string().describe('User wallet address') },
  • Handler function that fetches open orders for a user address via hlInfo, filters for outcome orders (coin starts with '#'), and returns formatted text with side, coin, size, price, and order ID.
    async ({ address }) => {
      const orders = await hlInfo<OpenOrder[]>({ type: 'openOrders', user: address });
      const outcomeOrders = orders.filter(o => o.coin.startsWith('#'));
    
      if (outcomeOrders.length === 0) {
        return { content: [{ type: 'text', text: 'No open outcome orders.' }] };
      }
    
      const lines = outcomeOrders.map(o => {
        return `${o.side.toUpperCase()} ${o.coin} ${o.sz} @ ${(parseFloat(o.limitPx) * 100).toFixed(1)}% (oid: ${o.oid})`;
      });
    
      return { content: [{ type: 'text', text: lines.join('\n') }] };
    },
  • hlInfo generic helper function that makes HTTP POST requests to the Hyperliquid API /info endpoint, used by the handler to fetch open orders.
    async function hlInfo<T>(body: object): Promise<T> {
      const res = await fetch(`${API_URL}/info`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(body),
      });
      if (!res.ok) throw new Error(`HL API error: ${res.status}`);
      return res.json() as Promise<T>;
    }
  • TypeScript interface for OpenOrder, defining the shape of open order data returned by the API (coin, limitPx, oid, side, sz, timestamp).
    interface OpenOrder {
      coin: string; limitPx: string; oid: number;
      side: string; sz: string; timestamp: number;
    }
Behavior2/5

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

No annotations provided, so the description must carry the burden. It only states it gets data but does not disclose behaviors like whether orders are sorted, paginated, or require authentication. No mention of side effects (read-only is implied). Minimal transparency.

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?

Extremely concise: one sentence of 8 words. No fluff. Front-loaded with verb and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 1 required param and no output schema, the description is too minimal. It does not explain what the return data looks like, error cases, or any constraints. With no annotations, more context is needed.

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 one parameter 'address' described as 'User wallet address'. The description adds no extra 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb 'Get' and resource 'open orders' with a qualifier 'for a user address'. It distinguishes itself from siblings like 'get_candles' by specifying the context, but does not explicitly differentiate from similar order-related tools like 'get_user_fills' or 'get_user_positions'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as 'get_user_fills' or 'get_orderbook'. No mention of prerequisites or typical use cases. The description is purely functional.

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/Liquidiction/liquidiction-mcp'

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