Skip to main content
Glama

get_tpsl

Read-onlyIdempotent

Retrieve take-profit and stop-loss order history from Hyperliquid with trigger prices, user addresses, and triggered status. Requires Pro+ tier access.

Instructions

Get Hyperliquid TP/SL order history (Pro+ tier). Returns take-profit and stop-loss orders with trigger prices, user addresses, and triggered status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin/market symbol, e.g. 'BTC', 'ETH', 'SOL'
startNoStart timestamp (Unix ms or ISO). Defaults to 24h ago.
endNoEnd timestamp (Unix ms or ISO). Defaults to now.
limitNoMax records to return (default 100, max 1000)
cursorNoPagination cursor from previous response's nextCursor
userNoUser wallet address filter (e.g., '0x1234...')
triggeredNoFilter TP/SL orders by triggered status

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordsYesArray of result records
countYesTotal number of records in the full result set
nextCursorNoCursor for next page, if more results available

Implementation Reference

  • src/index.ts:1055-1066 (registration)
    Registration of the 'get_tpsl' tool using registerHistoryTool pattern. It delegates to api().hyperliquid.orders.tpsl(coin, params) for the actual SDK call.
    registerHistoryTool(
      "get_tpsl",
      "Get Hyperliquid TP/SL order history (Pro+ tier). Returns take-profit and stop-loss orders with trigger prices, user addresses, and triggered status.",
      (coin, params) =>
        api().hyperliquid.orders.tpsl(coin, params as any),
      CoinParam,
      normalizeHLCoin,
      {
        user: UserParam,
        triggered: TriggeredParam,
      }
    );
  • The actual handler logic: calls api().hyperliquid.orders.tpsl(coin, params as any) which is the SDK method that retrieves TP/SL order history.
    "get_tpsl",
    "Get Hyperliquid TP/SL order history (Pro+ tier). Returns take-profit and stop-loss orders with trigger prices, user addresses, and triggered status.",
  • Input schema for 'get_tpsl': uses CoinParam (string), HistoryParams (start/end/limit/cursor), plus optional 'user' (UserParam) and 'triggered' (TriggeredParam) filters.
    (coin, params) =>
      api().hyperliquid.orders.tpsl(coin, params as any),
    CoinParam,
    normalizeHLCoin,
    {
      user: UserParam,
      triggered: TriggeredParam,
    }
  • Definition of OrderTypeParam which lists 'tpsl' as a valid order type, and TriggeredParam used by the get_tpsl tool for filtering by triggered status.
      .describe("Filter orders by type");
    
    const TriggeredParam = z
      .boolean()
      .optional()
      .describe("Filter TP/SL orders by triggered status");
  • The registerHistoryTool helper function that defines the registration pattern used by 'get_tpsl'. It wraps the SDK call with cursor pagination, time range resolution, and output formatting.
    function registerHistoryTool(
      name: string,
      description: string,
      sdkCall: (coin: string, params: Record<string, unknown>) => Promise<{ data: unknown; nextCursor?: string }>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string,
      extraSchema?: ZodRawShape
    ): void {
      const schema: ZodRawShape = { coin: coinSchema, ...HistoryParams };
      if (extraSchema) Object.assign(schema, extraSchema);
    
      registerTool(name, description, schema, ListOutputSchema, async (params) => {
        const { coin, start, end, limit, cursor, ...extra } = params;
    
        const timeRange = resolveTimeRange(start, end);
        const sdkParams: Record<string, unknown> = {
          ...timeRange,
          limit: resolveLimit(limit),
        };
    
        if (cursor) sdkParams.cursor = cursor;
    
        // Pass through extra params (interval, side, etc.)
        for (const [k, v] of Object.entries(extra)) {
          if (v !== undefined) sdkParams[k] = v;
        }
    
        const result = await sdkCall(normFn(coin), sdkParams);
        return formatCursorResponse(result);
      });
    }
Behavior4/5

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

Annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) already indicate safe read behavior. The description adds value by detailing returned fields (trigger prices, user addresses, triggered status), which supplements the annotations with concrete output context.

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?

Single sentence, front-loaded with key information (verb, resource, tier, return fields). No unnecessary words. Highly efficient.

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 output schema exists, so return value details are covered. The description mentions the returned fields and tier restriction. Missing explicit mention of pagination (cursor, limit) and filtering (user, triggered) but these are in the schema. Complete enough given structured fields.

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?

Input schema has 100% description coverage for all 7 parameters, each with clear descriptions. The tool description does not elaborate on any parameter details beyond what the schema provides, so it neither adds nor detracts significantly. 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?

Clearly states the tool retrieves Hyperliquid TP/SL order history, lists the fields returned (trigger prices, user addresses, triggered status), and specifies the Pro+ tier requirement, distinguishing it from sibling tools like get_hip3_tpsl and get_hip4_tpsl.

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?

Mentions 'Pro+ tier' implying access restrictions but provides no explicit when-to-use or when-not-to-use guidance. No alternatives are named among the many sibling tools, and pagination/filtering aspects are not mentioned.

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