Skip to main content
Glama
coinpaprika

DexPaprika (CoinPaprika)

Official

getPoolOHLCV

Retrieve historical OHLCV data for decentralized exchange pools to analyze price trends, perform backtesting, and create visualizations across multiple blockchain networks.

Instructions

Get historical price data (OHLCV) for a pool - essential for price analysis, backtesting, and visualization. Requires network and pool address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (e.g., "ethereum", "solana")
poolAddressYesPool address or identifier
startYesStart time for historical data (Unix timestamp, RFC3339 timestamp, or yyyy-mm-dd format)
endNoEnd time for historical data (max 1 year from start)
limitNoNumber of data points to retrieve (max 366) - adjust for different analysis needs
intervalNoInterval granularity: 1m, 5m, 10m, 15m, 30m, 1h, 6h, 12h, 24h24h
inversedNoWhether to invert the price ratio for alternative pair perspective (e.g., ETH/USDC vs USDC/ETH)

Implementation Reference

  • Handler function that constructs the DexPaprika API endpoint for retrieving historical OHLCV data for a specific pool and formats the response for MCP.
    async ({ network, poolAddress, start, end, limit, interval, inversed }) => {
      let endpoint = `/networks/${network}/pools/${poolAddress}/ohlcv?start=${encodeURIComponent(start)}&interval=${interval}&limit=${limit}&inversed=${inversed}`;
      if (end) {
        endpoint += `&end=${encodeURIComponent(end)}`;
      }
      const data = await fetchFromAPI(endpoint);
      return formatMcpResponse(data);
    }
  • Zod schema defining the input parameters for the getPoolOHLCV tool, including network, pool address, time range, limit, interval, and inversion option.
    {
      network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
      poolAddress: z.string().describe('Pool address or identifier'),
      start: z.string().describe('Start time for historical data (Unix timestamp, RFC3339 timestamp, or yyyy-mm-dd format)'),
      end: z.string().optional().describe('End time for historical data (max 1 year from start)'),
      limit: z.number().optional().default(1).describe('Number of data points to retrieve (max 366) - adjust for different analysis needs'),
      interval: z.string().optional().default('24h').describe('Interval granularity: 1m, 5m, 10m, 15m, 30m, 1h, 6h, 12h, 24h'),
      inversed: z.boolean().optional().default(false).describe('Whether to invert the price ratio for alternative pair perspective (e.g., ETH/USDC vs USDC/ETH)')
    },
  • src/index.js:195-215 (registration)
    MCP server.tool registration for the getPoolOHLCV tool, including name, description, schema, and handler.
    server.tool(
      'getPoolOHLCV',
      'Get historical price data (OHLCV) for a pool - essential for price analysis, backtesting, and visualization. Requires network and pool address.',
      {
        network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
        poolAddress: z.string().describe('Pool address or identifier'),
        start: z.string().describe('Start time for historical data (Unix timestamp, RFC3339 timestamp, or yyyy-mm-dd format)'),
        end: z.string().optional().describe('End time for historical data (max 1 year from start)'),
        limit: z.number().optional().default(1).describe('Number of data points to retrieve (max 366) - adjust for different analysis needs'),
        interval: z.string().optional().default('24h').describe('Interval granularity: 1m, 5m, 10m, 15m, 30m, 1h, 6h, 12h, 24h'),
        inversed: z.boolean().optional().default(false).describe('Whether to invert the price ratio for alternative pair perspective (e.g., ETH/USDC vs USDC/ETH)')
      },
      async ({ network, poolAddress, start, end, limit, interval, inversed }) => {
        let endpoint = `/networks/${network}/pools/${poolAddress}/ohlcv?start=${encodeURIComponent(start)}&interval=${interval}&limit=${limit}&inversed=${inversed}`;
        if (end) {
          endpoint += `&end=${encodeURIComponent(end)}`;
        }
        const data = await fetchFromAPI(endpoint);
        return formatMcpResponse(data);
      }
    );
  • Shared helper function to make API requests to DexPaprika, with comprehensive error handling for rate limits and deprecated endpoints.
    async function fetchFromAPI(endpoint) {
      try {
        const response = await fetch(`${API_BASE_URL}${endpoint}`);
        if (!response.ok) {
          if (response.status === 410) {
            throw new Error(
              'This endpoint has been permanently removed. Please use network-specific endpoints instead. ' +
              'For example, use /networks/{network}/pools instead of /pools. ' +
              'Get available networks first using the getNetworks function.'
            );
          }
          if (response.status === 429) {
            throw new Error(
              'Rate limit exceeded. You have reached the maximum number of requests allowed for the free tier. ' +
              'To increase your rate limits and access additional features, please consider upgrading to a paid plan at https://docs.dexpaprika.com/'
            );
          }
          throw new Error(`API request failed with status ${response.status}`);
        }
        return await response.json();
      } catch (error) {
        console.error(`Error fetching from API: ${error.message}`);
        throw error;
      }
  • Shared helper function to format API data into the MCP response structure.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the requirement for network and pool address, which is helpful context. However, it doesn't describe rate limits, authentication needs, error conditions, or what the return data structure looks like (though there's no output schema). The description adds some value but leaves significant behavioral aspects undocumented.

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?

The description is appropriately brief (two sentences) and front-loaded with the core purpose. The second sentence adds essential context about requirements. There's no wasted verbiage, though it could potentially be structured more clearly as separate sentences for purpose and requirements.

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?

For a tool with 7 parameters, no annotations, and no output schema, the description provides basic purpose and requirements but lacks details about return format, error handling, or behavioral constraints. The 100% schema coverage helps with parameters, but overall completeness is only adequate given the complexity of the tool.

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 description coverage is 100%, so the schema already fully documents all 7 parameters. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

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?

The description clearly states the specific action ('Get historical price data'), resource ('for a pool'), and data format ('OHLCV'). It distinguishes this tool from siblings like getPoolDetails or getPoolTransactions by focusing specifically on price history rather than general pool information or transaction data.

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

Usage Guidelines3/5

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

The description mentions use cases ('price analysis, backtesting, and visualization') which implies when to use this tool, but doesn't explicitly state when NOT to use it or name alternatives. It doesn't differentiate from potential sibling tools that might provide similar data in different formats or contexts.

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/coinpaprika/dexpaprika-mcp'

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