Skip to main content
Glama

Token OHLCV

getTokenOHLCV
Read-onlyIdempotent

Get historical USD OHLCV candles for one token over a time range, returned as a time-series array. The price and volume are computed across every pool the token trades in on the network (a volume-weighted price, and volume summed across those pools), not a single pair. Runs on the caller's own Dev, Pro or Enterprise API key, set as the Authorization header on the connection to this server; without one it returns DP401_API_KEY_REQUIRED and sends nothing upstream, and a free key gets 403. In either case fall back to getPoolOHLCV on the token's main pool, found with getTokenPools sorted by volume. Use for 'price history of this token' or 'USD chart for this token'; for a single pair's candles use getPoolOHLCV, and for the current price use getTokenDetails. Params: network (required); token_address (required); start (required; easiest as a relative offset from now such as '-24h', so you need not know today's date; also Unix seconds, RFC3339 or yyyy-mm-dd); end (optional, same formats); interval one of '1m','5m','10m','15m','30m','1h','6h','12h','24h' (default '24h'); limit (default 10, max 1000 candles). Dev plan history is limited to the last 30 days. There is no inversed parameter on this endpoint.

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": {
      "network": "<network>",
      "token_address": "<token_address>",
      "start": "<start>",
      "rationale": "<rationale>"
    },
    "name": "getTokenOHLCV"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoOPTIONAL: End time, same formats as start (e.g. '-1h')
limitNoOPTIONAL: Number of data points to retrieve (default: 10, max: 1000)
startYesREQUIRED: Start time. A relative offset from now is simplest and needs no knowledge of today's date: '-24h' (last 24 hours), '-7d', '-90m' (units s, m, h, d). Also accepts RFC3339 (e.g. '2024-01-01T00:00:00Z'), Unix epoch seconds and YYYY-MM-DD (treated as 00:00:00 UTC).
networkYesREQUIRED: Network ID from getNetworks (e.g., 'ethereum', 'solana')
intervalNoOPTIONAL: Interval granularity (default: '24h')24h
rationaleYesREQUIRED. 1-2 sentence rationale for this call (e.g. "User asked for X; calling Y to fetch Z"). Logged for MCP improvement, never shown to end users. No PII or secrets. See the server `instructions` field for the full convention and worked examples.
token_addressYesREQUIRED: Token contract address

Output Schema

NameRequiredDescriptionDefault
ohlcvYesUSD candles for the token across all its pools, ordered by time_open ascending.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedOutput schema / properties / ohlcv / items / additionalProperties
      Removed value: -true
    • addedOutput schema / properties / ohlcv / items / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "close": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "high": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "low": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "open": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "time_close": {
      +        "description": "ISO 8601 timestamp of bucket close (inclusive at 23:59:59 for 24h).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "time_open": {
      +        "description": "ISO 8601 timestamp of bucket open.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "volume": {
      +        "description": "Trade volume in the bucket, in pair-quote units (or USD where applicable).",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / ohlcv / items / properties
      Removed value: -{
      -  "close": {
      -    "type": "number"
      -  },
      -  "high": {
      -    "type": "number"
      -  },
      -  "low": {
      -    "type": "number"
      -  },
      -  "open": {
      -    "type": "number"
      -  },
      -  "time_close": {
      -    "description": "ISO 8601 timestamp of bucket close (inclusive at 23:59:59 for 24h).",
      -    "type": "string"
      -  },
      -  "time_open": {
      -    "description": "ISO 8601 timestamp of bucket open.",
      -    "type": "string"
      -  },
      -  "volume": {
      -    "description": "Trade volume in the bucket, in pair-quote units (or USD where applicable).",
      -    "type": "number"
      -  }
      -}
    • removedOutput schema / properties / ohlcv / items / type
      Removed value: -"object"
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations (readOnly/idempotent/non-destructive), the description discloses auth requirements (caller's own Dev/Pro/Enterprise key via Authorization header), the exact failure modes (DP401_API_KEY_REQUIRED with nothing sent upstream, 403 for a free key), and a plan limit (Dev history capped at 30 days). Those are real behavioral traits an agent cannot get from structured fields. It stops short of describing pagination or candle-field contents, though the output schema covers return shape.

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 aggregation semantics, then auth/error behavior, then use-cases, then parameters — a sensible priority order. It is dense but not padded; the main cost is that the trailing parameter sentence largely re-enumerates what the schema already declares verbatim.

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 7-parameter read tool with an output schema, the description covers what the output schema cannot: cross-pool aggregation, key requirements and error codes, plan-based history limits, and the fallback path. Nothing an agent needs in order to call this 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 100%, so the baseline is 3, but the description adds genuine semantics: 'start' is framed as a relative offset from now so no date knowledge is required, the interval enum and limit default/max are restated, and it explicitly notes 'There is no inversed parameter on this endpoint' — a negative disclosure the schema cannot express and that prevents a plausible wrong call.

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+resource+scope: 'Get historical USD OHLCV candles for one token over a time range, returned as a time-series array.' It immediately distinguishes itself from siblings by stating the price/volume are aggregated across every pool, 'not a single pair,' which separates it from getPoolOHLCV without opening a schema.

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?

Names the positive triggers ('price history of this token', 'USD chart for this token') and the two alternatives with the condition that selects each: getPoolOHLCV for a single pair's candles, getTokenDetails for current price. It also gives an explicit failure-path fallback (getPoolOHLCV on the main pool from getTokenPools sorted by volume), leaving nothing to inference.

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.

Resources