Skip to main content
Glama

Loading price data

token_ohlcv
Read-onlyIdempotent

Get OHLCV (Open, High, Low, Close, Volume) price data for a token with automatic interval resolution.

Supports EVM chains and Solana for on-chain tokens, AND Hyperliquid perpetual futures. For Hyperliquid perps, pass chain="hyperliquid" and use the perp symbol as tokenAddress (e.g. "BTC", "HYPE" for native perps; "XYZ:ORDI" for XYZ-namespaced perps — prefix is normalized automatically).

Use this tool for current and historical prices. The output starts with the current price. To get LATEST price set from to '5MIN_AGO' and to to 'NOW'.

Resolution is automatically calculated based on the date range

  • < 6 hours: 5 minutes

  • 6 hours - 1 day: 15 minutes

  • 1-3 days: 30 minutes

  • 3-7 days: 60 minutes (1 hour)

  • 7-90 days: Daily

  • 90+ days: Weekly

Columns returned:

  • Interval Start: Timestamp of the start of the interval (datetime: YYYY-MM-DD HH:MM:SS)

  • Open: Opening price of the interval

  • High: Highest price of the interval

  • Low: Lowest price of the interval

  • Close: Closing price of the interval

  • Volume USD: Volume in USD of the interval

Additional columns (when includeMarketCap=true):

  • Open Market Cap: Opening market cap in USD

  • Close Market Cap: Closing market cap in USD

  • High Market Cap: Highest market cap in USD

  • Low Market Cap: Lowest market cap in USD

Example Usage: Get OHLCV for WETH over the past week (auto-resolution): { "chain": "ethereum", "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196", "date": { "from": "7D_AGO", "to": "NOW" } }

Get OHLCV for WETH over 30 days (will use daily resolution):
```
{
    "chain": "ethereum",
    "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196",
    "date": {
        "from": "30D_AGO",
        "to": "NOW"
    }
}
```
Get OHLCV for WETH for last 20 minutes (will use 5 minute resolution):
```
{
    "chain": "ethereum",
    "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196",
    "date": {
        "from": "20MIN_AGO",
        "to": "NOW"
    }
}
```

Get OHLCV for the BTC Hyperliquid perp over 7 days:
```
{
    "chain": "hyperliquid",
    "tokenAddress": "BTC",
    "date": {
        "from": "7D_AGO",
        "to": "NOW"
    }
}
```

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": {
      "request": "<request>"
    },
    "name": "token_ohlcv"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestYesUnified request model for TGM OHLCV endpoint (flattened). Resolution is automatically calculated based on the date range to keep responses at approximately 100 rows, preventing context overflow.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / request / properties / chain / description
      Added value: +"Blockchain network for the token. Use the chain returned by general_search."
    • addedInput schema / properties / request / properties / tokenAddress / description
      Added value: +"Token contract address or Solana mint address. Use general_search to resolve a token name to its address and chain. For a tool with a perps mode, use the Hyperliquid coin symbol in that mode."
  2. Changed6 schema fields changed
    • addedInput schema / properties / request / additionalProperties
      Added value: +false
    • removedInput schema / properties / request / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      -    "properties": {
      -      "chain": {
      -        "type": "string"
      -      },
      -      "date": {
      -        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      -        "properties": {
      -          "from": {
      -            "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "includeMarketCap": {
      -        "default": false,
      -        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "chain",
      -      "tokenAddress",
      -      "date"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / request / description
      Added value: +"Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow."
    • addedInput schema / properties / request / properties
      Added value: +{
      +  "chain": {
      +    "type": "string"
      +  },
      +  "date": {
      +    "additionalProperties": false,
      +    "description": "Date range for OHLCV data with 'from' and 'to' fields",
      +    "properties": {
      +      "from": {
      +        "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +        "type": "string"
      +      },
      +      "to": {
      +        "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "from",
      +      "to"
      +    ],
      +    "type": "object"
      +  },
      +  "includeMarketCap": {
      +    "default": false,
      +    "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      +    "type": "boolean"
      +  },
      +  "tokenAddress": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / request / required
      Added value: +[
      +  "chain",
      +  "tokenAddress",
      +  "date"
      +]
    • addedInput schema / properties / request / type
      Added value: +"object"
  3. Changed1 schema field changed
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      -    "properties": {
      -      "chain": {
      -        "type": "string"
      -      },
      -      "date": {
      -        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      -        "properties": {
      -          "from": {
      -            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "includeMarketCap": {
      -        "default": false,
      -        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "chain",
      -      "tokenAddress",
      -      "date"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      +    "properties": {
      +      "chain": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      +        "properties": {
      +          "from": {
      +            "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "includeMarketCap": {
      +        "default": false,
      +        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "chain",
      +      "tokenAddress",
      +      "date"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed3 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "DateRange": {
      -    "description": "Date range via tokens or dates.\nTokens: NOW, XMIN_AGO, XD_AGO, XH_AGO; THIS_YEAR_START, THIS_QUARTER_START, THIS_MONTH_START, THIS_WEEK_START, TODAY_START; LAST_WEEK_START/END, LAST_MONTH_START/END, LAST_QUARTER_START/END, LAST_YEAR_START/END.\nWeek starts Monday. Quarters are calendar. Dates: YYYY-MM-DD or ___-MM-DD (year omitted).\nPlease check detailed system instructions for more information.",
      -    "properties": {
      -      "from": {
      -        "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      },
      -      "to": {
      -        "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "from",
      -      "to"
      -    ],
      -    "type": "object"
      -  },
      -  "TgmOhlcvUnifiedRequest": {
      -    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      -    "properties": {
      -      "chain": {
      -        "type": "string"
      -      },
      -      "date": {
      -        "$ref": "#/$defs/DateRange",
      -        "description": "Date range for OHLCV data with 'from' and 'to' fields"
      -      },
      -      "includeMarketCap": {
      -        "default": false,
      -        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "chain",
      -      "tokenAddress",
      -      "date"
      -    ],
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "$ref": "#/$defs/TgmOhlcvUnifiedRequest"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      +    "properties": {
      +      "chain": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "includeMarketCap": {
      +        "default": false,
      +        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "chain",
      +      "tokenAddress",
      +      "date"
      +    ],
      +    "type": "object"
      +  }
      +]
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior, so the description only needs to add context — and it does: it discloses the automatic interval-resolution rules tied to date range, the ~100-row row-budget implication, the exact returned columns, the extra market-cap columns when includeMarketCap=true, and the automatic normalization of XYZ-namespaced perp prefixes. It omits error behavior and rate limits, keeping it short of a 5.

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 and mode scoping, then resolution rules, then return columns, then examples — a sensible hierarchy. It is long, but each of the four examples illustrates a distinct case (7d, 30d, 20min resolution tiers and perps mode) rather than repeating one payload, so the length is largely earned.

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 tool with a nested request object, a perps mode, and auto-resolution logic, the description covers modes, parameter conventions, resolution mapping, and output shape. An output schema exists, so return-value documentation is a bonus rather than a necessity, and the description loses nothing an agent would need before calling it.

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 real meaning the schema lacks: date tokens like '5MIN_AGO', '7D_AGO', 'NOW' are demonstrated in examples while the schema only describes generic token/date syntax, and the hyperliquid value for chain plus perp-symbol usage of tokenAddress are made concrete where the schema is vague ('in that mode'). The includeMarketCap output effect is also spelled out.

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?

States a specific verb and resource ('Get OHLCV ... price data for a token') and immediately scopes the coverage: EVM chains, Solana, and Hyperliquid perpetuals. That scope statement alone distinguishes it from sibling tools like token_dex_trades or token_technical_indicators without opening their schemas.

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?

Explicitly says 'Use this tool for current and historical prices' and gives a concrete recipe for the latest price (from '5MIN_AGO' to 'NOW'), plus a distinct invocation pattern for Hyperliquid perps (chain="hyperliquid", perp symbol as tokenAddress). It does not, however, name any sibling alternative or state when a different price/trade tool should be preferred, so routing between token_ohlcv and token_dex_trades is left 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