get_token_candle_data
Retrieve historical price candle data for cryptocurrency tokens to perform technical analysis and market research.
Instructions
Get candle data about any token for analysis.
Expects a CandleStickRequest, returns a list of candle sticks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| candle_stick_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:610-624 (handler)The main handler function for the 'get_token_candle_data' tool, decorated with @mcp.tool() for registration in FastMCP. It handles authentication check, calls the armor_client helper, and returns candle data or error.@mcp.tool() async def get_token_candle_data(candle_stick_requests: CandleStickRequest) -> List: """ Get candle data about any token for analysis. Expects a CandleStickRequest, returns a list of candle sticks. """ if not armor_client: return [{"error": "Not logged in"}] try: result: List = await armor_client.get_market_candle_data(candle_stick_requests) return result except Exception as e: return [{"error": str(e)}]
- Pydantic model defining the input schema for the candle data request, including token address, time interval, time range, and market cap option.class CandleStickRequest(BaseModel): token_address: str = Field(description="Public mint address of the token. To get the address from a token symbol use `get_token_details`") time_interval: Literal["1s", "5s", "15s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mn"] = Field(default="1h", description="Time frame to get the candle sticks. Use larger candle time frames over larger time windows to keep returned candles minimal") time_from: str = Field(description="The time from which to start the candle data in ISO 8601 format. Attempt to change this to keep number of candles returned under 64.") time_to: Optional[str] = Field(default=None, description="The time to end the candle data in ISO 8601 format. Use only for historic analysis.") market_cap: Optional[bool] = Field(default=False, description="Whether to return the marketcap of the token instead of the price")
- Helper method in ArmorWalletAPIClient that serializes the request and makes a POST API call to '/tokens/candles/' to retrieve the candle data from the backend service.async def get_market_candle_data(self, data: CandleStickRequest) -> Dict: """Get the candle sticks.""" payload = data.model_dump(exclude_none=True) return await self._api_call("POST", f"tokens/candles/", payload)