Skip to main content
Glama

OHLCV candles (paid, x402) — $0.003

get_candles
Read-onlyIdempotent

Use when you need OHLCV candles for a Hyperliquid perp or OKX spot pair for charting or indicators. OHLCV candles API ($0.003/call, USDC on Base via x402): any Hyperliquid perp (venue=hyperliquid default; main dex + HIP-3; 1m to 1M intervals; limit 1-500, default 100; optional end for older candles) or any OKX USDT spot pair (venue=okx; limit 1-300; most recent only). Each candle: open time, close time, o/h/l/c, volume, trade count, closed flag. Errors: no charge. Example: GET https://cryptofeed402.site/candles/BTC?interval=1h&limit=100

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "limit": 100,
      "symbol": "BTC",
      "interval": "1h"
    },
    "name": "get_candles"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoHyperliquid only: end time, epoch ms or YYYY-MM-DD / ISO 8601 UTC
limitNoDefault 100; max 300 for okx
venueNo
symbolYesHyperliquid perp ticker, e.g. BTC, ETH, kPEPE; HIP-3 builder-dex perps as dex:TICKER, e.g. xyz:TSLA; for venue=okx a spot base ticker, e.g. PEPE
intervalNoDefault 1h. 3d/8h are Hyperliquid only, 6h is OKX only

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "accepts": {
      +          "items": {
      +            "properties": {
      +              "amount": {
      +                "description": "USDC atomic units (6 decimals)",
      +                "type": "string"
      +              },
      +              "asset": {
      +                "type": "string"
      +              },
      +              "extra": {
      +                "type": "object"
      +              },
      +              "maxTimeoutSeconds": {
      +                "type": "number"
      +              },
      +              "network": {
      +                "const": "eip155:8453",
      +                "type": "string"
      +              },
      +              "payTo": {
      +                "type": "string"
      +              },
      +              "scheme": {
      +                "const": "exact",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "scheme",
      +              "network",
      +              "amount",
      +              "asset",
      +              "payTo"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "resource": {
      +          "properties": {
      +            "description": {
      +              "type": "string"
      +            },
      +            "mimeType": {
      +              "type": "string"
      +            },
      +            "url": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "x402Version": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "x402Version",
      +        "accepts"
      +      ],
      +      "title": "x402 PaymentRequired (what this MCP tool returns, isError=true)",
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "as_of": {
      +          "description": "ISO-8601 UTC",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "candles": {
      +          "description": "[{t, close_time, o, h, l, c, v, n, closed}]",
      +          "items": {
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "count": {
      +          "description": "Candles returned",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "disclaimer": {
      +          "description": "Not financial advice notice",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "fields": {
      +          "description": "Legend for candle keys",
      +          "properties": {
      +            "c": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "close_time": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "closed": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "h": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "l": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "n": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "o": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "t": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "v": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "generated_at": {
      +          "description": "Response time",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "interval": {
      +          "description": "Candle interval",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "limit": {
      +          "description": "Limit applied",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "market": {
      +          "description": "perp or spot",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "options": {
      +          "description": "Accepted values for params",
      +          "properties": {
      +            "end": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "interval": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "limit": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "venue": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "price_basis": {
      +          "description": "Price basis note",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "provenance": {
      +          "description": "Optional provenance on paid 200s",
      +          "properties": {
      +            "data_sha256": {
      +              "type": "string"
      +            },
      +            "fetched_at": {
      +              "type": "string"
      +            },
      +            "max_age_s": {
      +              "type": "number"
      +            },
      +            "source": {
      +              "type": "string"
      +            },
      +            "sources": {
      +              "type": "array"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "source": {
      +          "description": "Upstream source",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "symbol": {
      +          "description": "Ticker",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "venue": {
      +          "description": "hyperliquid or okx",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "window": {
      +          "description": "{from, to, end_param}",
      +          "properties": {
      +            "end_param": {},
      +            "from": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "to": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "as_of",
      +        "candles",
      +        "count",
      +        "disclaimer",
      +        "fields",
      +        "generated_at",
      +        "interval",
      +        "limit",
      +        "market",
      +        "options",
      +        "price_basis",
      +        "source",
      +        "symbol",
      +        "venue",
      +        "window"
      +      ],
      +      "title": "Paid HTTP 200 body of GET /candles/{symbol}",
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "interval": "1h",
      +    "limit": 100,
      +    "symbol": "BTC"
      +  }
      +]
    • addedInput schema / properties / interval / examples
      Added value: +[
      +  "1h"
      +]
    • addedInput schema / properties / limit / examples
      Added value: +[
      +  100
      +]
    • addedInput schema / properties / symbol / examples
      Added value: +[
      +  "BTC"
      +]
  3. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, open-world, but the description adds what they cannot: this is a paid call at $0.003/call in USDC on Base via x402, and errors are not charged. It also discloses per-candle return fields and venue-specific limits (500 vs 300, OKX recent-only), which is exactly the kind of context the annotations lack.

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?

It is front-loaded with the use case, then packs venue, interval, limit, and return-shape details into a tight block, ending with a concrete request example. The middle sentence is dense and parenthesis-heavy, but nearly every clause carries actionable information.

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 paid, multi-venue data read, the description covers cost and billing failure behavior, venue constraints, interval restrictions, pagination limits, and return fields. An output schema exists, so the candle field list is a bonus rather than a requirement, and nothing needed to call it correctly is missing.

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 80%, so baseline is 3; the description exceeds it by supplying the default venue (hyperliquid) and dex/HIP-3 semantics, the default limit of 100 with the 1-500 vs 1-300 split, and the purpose of 'end' (reaching older candles). It does not add syntax detail for the 'end' formats beyond the schema's own description.

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?

The description states a specific resource (OHLCV candles) with an explicit scope: Hyperliquid perps or OKX USDT spot pairs, for charting or indicators. That scope implicitly separates it from price/history siblings, but no sibling is named, so the differentiation is inferred rather than stated.

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

Usage Guidelines4/5

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

The opening 'Use when you need OHLCV candles ... for charting or indicators' gives clear context, and venue-specific rules sharpen it (OKX is most-recent-only, some intervals are venue-exclusive). It stops short of naming an alternative tool or stating when not to use it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.