Skip to main content
Glama

dexPairsOhlcvLatest

Retrieve current UTC day OHLCV market values for one or more spot pairs. Use contract address, network ID, or slug to fetch accurate cryptocurrency market data.

Instructions

Returns the latest OHLCV market values for one or more spot pairs for the current UTC day.

Input Schema

NameRequiredDescriptionDefault
auxNo
contract_addressNo
convert_idNo
network_idNo
network_slugNo
reverse_orderNo
skip_invalidNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "aux": { "type": "string" }, "contract_address": { "type": "string" }, "convert_id": { "type": "string" }, "network_id": { "type": "string" }, "network_slug": { "type": "string" }, "reverse_order": { "type": "string" }, "skip_invalid": { "type": "string" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'dexPairsOhlcvLatest' tool. It invokes handleEndpoint which makes an API request to the CoinMarketCap endpoint '/v4/dex/pairs/ohlcv/latest' with the provided parameters, formats the response, and returns it.
    async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v4/dex/pairs/ohlcv/latest', params) return formatResponse(data) }) }
  • Zod schema defining the input parameters for the tool, all optional strings.
    { contract_address: z.string().optional(), network_id: z.string().optional(), network_slug: z.string().optional(), aux: z.string().optional(), convert_id: z.string().optional(), skip_invalid: z.string().optional(), reverse_order: z.string().optional() },
  • index.js:374-391 (registration)
    The registration of the 'dexPairsOhlcvLatest' tool using server.tool, including name, description, schema, and handler function.
    server.tool("dexPairsOhlcvLatest", "Returns the latest OHLCV market values for one or more spot pairs for the current UTC day.", { contract_address: z.string().optional(), network_id: z.string().optional(), network_slug: z.string().optional(), aux: z.string().optional(), convert_id: z.string().optional(), skip_invalid: z.string().optional(), reverse_order: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v4/dex/pairs/ohlcv/latest', params) return formatResponse(data) }) } )

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/shinzo-labs/coinmarketcap-mcp'

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