Skip to main content
Glama

get_candles

Read-only

Fetch OHLCV candles for a Hyperliquid coin to analyze price trends, support/resistance, volatility, or backtest strategies. Choose recent counts or a fixed time window by interval.

Instructions

Get OHLCV candles for one coin. Returns [{t, o, h, l, c, v}], oldest first, t in unix ms. Two modes: the last count candles at interval (default 100 x 1h; the newest one may still be forming, so one extra can come back), or a fixed window when start_time is given (end_time defaults to now; count is then ignored). interval is one of Hyperliquid's: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M. Use for trend, levels, volatility and backtests. For the price right now use get_market; for depth use get_order_book. Read-only; needs no key. Window mode returns {coin, interval, start, end, count, candles[]}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "coin": "<coin>"
    },
    "name": "get_candles"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesCoin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL).
countNoHow many recent candles (default 100; ignored with start_time).
end_timeNoWindow end (default now). Unix time in milliseconds.
intervalNoCandle size: 1m, 5m, 15m, 1h, 4h, 1d, ... (default 1h).
start_timeNoWindow start; switches to window mode. Unix time in milliseconds.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.6.1
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / coin / description
      Previous value: -"Coin ticker (default BTC)"New value: +"Coin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL)."
    • changedInput schema / properties / count / description
      Previous value: -"Number of candles (default 100)"New value: +"How many recent candles (default 100; ignored with start_time)."
    • addedInput schema / properties / count / minimum
      Added value: +1
    • changedInput schema / properties / count / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / end_time
      Added value: +{
      +  "description": "Window end (default now). Unix time in milliseconds.",
      +  "type": "number"
      +}
    • changedInput schema / properties / interval / description
      Previous value: -"Candle interval (default 1h)"New value: +"Candle size: 1m, 5m, 15m, 1h, 4h, 1d, ... (default 1h)."
    • addedInput schema / properties / start_time
      Added value: +{
      +  "description": "Window start; switches to window mode. Unix time in milliseconds.",
      +  "type": "number"
      +}
    • addedInput schema / required
      Added value: +[
      +  "coin"
      +]
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, but the description goes further: it states auth is unneeded, discloses the return array shape and timestamp units, warns the newest candle may still be forming (one extra may come back), and explains that count is ignored in window mode. Minor redundancy in repeating "read-only", which the annotation already declares.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then return shape, then mode semantics, then alternatives — a sensible priority order with no filler sentences. It is a dense single paragraph of roughly 90 words; light structuring would improve scanability but nothing is wasted.

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?

Despite having no output schema, the description documents both return shapes ({t,o,h,l,c,v} list and the window-mode envelope), timestamp units, and ordering. Combined with full schema coverage and the readOnly annotation, an agent has everything needed to call this correctly.

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?

Schema coverage is 100%, so baseline would be 3, but the description adds real semantics: count defaults to 100 and is ignored with start_time, end_time defaults to now, and the full interval enumeration (3m, 30m, 2h, 8h, 12h, 3d, 1w, 1M) is richer than the truncated list in the schema.

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?

Opens with a specific verb and resource ("Get OHLCV candles for one coin") and immediately scopes the return shape. It distinguishes itself from siblings by naming get_market for spot price and get_order_book for depth, so an agent can pick the right tool without reading sibling schemas.

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

Usage Guidelines5/5

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

Gives explicit positive use cases (trend, levels, volatility, backtests) and explicit exclusions with named alternatives (get_market for current price, get_order_book for depth). It also spells out the two calling modes and when each applies (count-only vs. start_time window).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.