Skip to main content
Glama

candles

Retrieve OHLCV candlestick data for cryptocurrency analysis. Get open, high, low, close prices with historical periods to track market trends and price movements.

Instructions

Get OHLCV candlestick data for any crypto. Returns open, high, low, close for each period.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesCrypto symbol
daysNoNumber of days of history (1, 7, 14, 30, 90, 180, 365). Default: 7

Implementation Reference

  • index.js:80-99 (handler)
    The function `getCryptoCandles` fetches and returns OHLCV candlestick data from CoinGecko.
    async function getCryptoCandles(symbol, interval = '1h', days = 7) {
      const id = symbol.toLowerCase().replace('usdt', '').replace('usd', '');
      const idMap = {
        btc: 'bitcoin', eth: 'ethereum', sol: 'solana', doge: 'dogecoin',
        xrp: 'ripple', bnb: 'binancecoin', ada: 'cardano', avax: 'avalanche-2',
      };
      const coinId = idMap[id] || id;
    
      const data = await fetch(
        `https://api.coingecko.com/api/v3/coins/${coinId}/ohlc?vs_currency=usd&days=${days}`
      );
    
      return data.map(c => ({
        time: new Date(c[0]).toISOString(),
        open: c[1],
        high: c[2],
        low: c[3],
        close: c[4],
      }));
    }
  • Tool registration definition for "candles" including input schema.
    {
      name: 'candles',
      description: 'Get OHLCV candlestick data for any crypto. Returns open, high, low, close for each period.',
      inputSchema: {
        type: 'object',
        properties: {
          symbol: { type: 'string', description: 'Crypto symbol' },
          days: { type: 'number', description: 'Number of days of history (1, 7, 14, 30, 90, 180, 365). Default: 7' }
        },
        required: ['symbol']
      }
    },
  • index.js:323-324 (registration)
    Tool invocation handler for "candles" within the main MCP request loop.
    case 'candles':
      return await getCryptoCandles(args.symbol, '1h', args.days || 7);
Behavior3/5

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

With no annotations provided, description carries full burden. It explains return structure ('open, high, low, close') which compensates partially for missing output schema, but omits critical operational details: rate limits, data freshness/latency, or error behavior when invalid symbol provided.

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?

Two efficient sentences with zero waste. First sentence establishes purpose, second explains return format. Front-loaded with actionable verb and domain context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a 2-parameter read tool with complete schema coverage. Description successfully expands OHLCV acronym since no output schema exists, but lacks error handling guidance or rate limit disclosures expected for crypto API tools.

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?

Schema coverage is 100%, establishing baseline 3. Description mentions 'any crypto' (mapping to symbol) and 'each period' (vaguely relating to days), but doesn't clarify the relationship between days parameter and candle granularity, or explain that days accepts discrete values only.

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?

Clear verb ('Get') and resource ('OHLCV candlestick data') with domain ('crypto'), successfully distinguishes from sibling 'price' by specifying historical candlestick data format. Loses one point for not clarifying difference from 'analyze' which could also involve price data.

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

Usage Guidelines2/5

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

No guidance on when to use this versus siblings like 'price' (current vs. historical) or 'analyze'. Does not mention that 'days' parameter accepts only specific values (1, 7, 14, 30, 90, 180, 365) even though schema lists them.

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/ShipItAndPray/mcp-market-data'

If you have feedback or need assistance with the MCP directory API, please join our Discord server