Skip to main content
Glama
CoinStatsHQ

CoinStats MCP Server

Official

get-coins

Retrieve cryptocurrency data including prices, market caps, volumes, supply metrics, and trading information with customizable filters for analysis and decision-making.

Instructions

Get comprehensive data about all cryptocurrencies: Price, market cap, and volume. Price changes (1h, 24h, 7d). Supply information. Trading metrics. Social links and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSearch coins by name
pageNoPage number
limitNoNumber of results per page
currencyNoCurrency for price dataUSD
symbolNoGet coins by symbol
blockchainsNoBlockchain filters, separated by commas (e.g., ethereum,solana)
includeRiskScoreNoInclude risk score: true or false. Default - false
categoriesNoCategory filters, separated by commas (e.g., memecoins,sports)
sortByNoField to sort by
sortDirNoSort direction
marketCap-greaterThanNoMarketcap Greater Than
marketCap-equalsNoMarketcap Equals
marketCap-lessThanNoMarketcap Less Than
fullyDilutedValuation-greaterThanNoFully Diluted Valuation Greater Than
fullyDilutedValuation-equalsNoFully Diluted Valuation Equals
fullyDilutedValuation-lessThanNoFully Diluted Valuation Less Than
volume-greaterThanNoVolume Greater Than
volume-equalsNoVolume Equals
volume-lessThanNoVolume Less Than
priceChange1h-greaterThanNoPrice Change 1h Greater Than
priceChange1h-equalsNoPrice Change 1h Equals
priceChange1h-lessThanNoPrice Change 1h Less Than
priceChange1d-greaterThanNoPrice Change 1d Greater Than
priceChange1d-equalsNoPrice Change 1d Equals
priceChange1d-lessThanNoPrice Change 1d Less Than
priceChange7d-greaterThanNoPrice Change 7d Greater Than
priceChange7d-equalsNoPrice Change 7d Equals
priceChange7d-lessThanNoPrice Change 7d Less Than
availableSupply-greaterThanNoAvailable Supply Greater Than
availableSupply-equalsNoAvailable Supply Equals
availableSupply-lessThanNoAvailable Supply Less Than
totalSupply-greaterThanNoTotal Supply Greater Than
totalSupply-equalsNoTotal Supply Equals
totalSupply-lessThanNoTotal Supply Less Than
rank-greaterThanNoRank Greater Than
rank-equalsNoRank Equals
rank-lessThanNoRank Less Than
price-greaterThanNoPrice Greater Than
price-equalsNoPrice Equals
price-lessThanNoPrice Less Than
riskScore-greaterThanNoRisk Score Greater Than (Only if includeRiskScore=true)
riskScore-equalsNoRisk Score Equals (Only if includeRiskScore=true)
riskScore-lessThanNoRisk Score Less Than (Only if includeRiskScore=true)

Implementation Reference

  • Defines the schema, description, endpoint, method, and Zod parameter schemas for the 'get-coins' tool.
    {
        name: 'get-coins',
        description:
            'Get comprehensive data about all cryptocurrencies: Price, market cap, and volume. Price changes (1h, 24h, 7d). Supply information. Trading metrics. Social links and metadata.',
        endpoint: '/coins',
        method: 'GET',
        parameters: {
            name: z.string().optional().describe('Search coins by name'),
            page: z.number().optional().describe('Page number').default(1),
            limit: z.number().optional().describe('Number of results per page').default(20),
            currency: z.string().optional().describe('Currency for price data').default('USD'),
            symbol: z.string().optional().describe('Get coins by symbol'),
            blockchains: z.string().optional().describe('Blockchain filters, separated by commas (e.g., ethereum,solana)'),
            includeRiskScore: z.string().optional().describe('Include risk score: true or false. Default - false'),
            categories: z.string().optional().describe('Category filters, separated by commas (e.g., memecoins,sports)'),
            sortBy: z.string().optional().describe('Field to sort by'),
            sortDir: z.enum(['asc', 'desc']).optional().describe('Sort direction'),
    
            // Market Cap filters
            'marketCap-greaterThan': z.number().optional().describe('Marketcap Greater Than'),
            'marketCap-equals': z.number().optional().describe('Marketcap Equals'),
            'marketCap-lessThan': z.number().optional().describe('Marketcap Less Than'),
    
            // Fully Diluted Valuation filters
            'fullyDilutedValuation-greaterThan': z.number().optional().describe('Fully Diluted Valuation Greater Than'),
            'fullyDilutedValuation-equals': z.number().optional().describe('Fully Diluted Valuation Equals'),
            'fullyDilutedValuation-lessThan': z.number().optional().describe('Fully Diluted Valuation Less Than'),
    
            // Volume filters
            'volume-greaterThan': z.number().optional().describe('Volume Greater Than'),
            'volume-equals': z.number().optional().describe('Volume Equals'),
            'volume-lessThan': z.number().optional().describe('Volume Less Than'),
    
            // Price Change filters
            'priceChange1h-greaterThan': z.number().optional().describe('Price Change 1h Greater Than'),
            'priceChange1h-equals': z.number().optional().describe('Price Change 1h Equals'),
            'priceChange1h-lessThan': z.number().optional().describe('Price Change 1h Less Than'),
    
            'priceChange1d-greaterThan': z.number().optional().describe('Price Change 1d Greater Than'),
            'priceChange1d-equals': z.number().optional().describe('Price Change 1d Equals'),
            'priceChange1d-lessThan': z.number().optional().describe('Price Change 1d Less Than'),
    
            'priceChange7d-greaterThan': z.number().optional().describe('Price Change 7d Greater Than'),
            'priceChange7d-equals': z.number().optional().describe('Price Change 7d Equals'),
            'priceChange7d-lessThan': z.number().optional().describe('Price Change 7d Less Than'),
    
            // Supply filters
            'availableSupply-greaterThan': z.number().optional().describe('Available Supply Greater Than'),
            'availableSupply-equals': z.number().optional().describe('Available Supply Equals'),
            'availableSupply-lessThan': z.number().optional().describe('Available Supply Less Than'),
    
            'totalSupply-greaterThan': z.number().optional().describe('Total Supply Greater Than'),
            'totalSupply-equals': z.number().optional().describe('Total Supply Equals'),
            'totalSupply-lessThan': z.number().optional().describe('Total Supply Less Than'),
    
            // Rank filters
            'rank-greaterThan': z.number().optional().describe('Rank Greater Than'),
            'rank-equals': z.number().optional().describe('Rank Equals'),
            'rank-lessThan': z.number().optional().describe('Rank Less Than'),
    
            // Price filters
            'price-greaterThan': z.number().optional().describe('Price Greater Than'),
            'price-equals': z.number().optional().describe('Price Equals'),
            'price-lessThan': z.number().optional().describe('Price Less Than'),
    
            // Risk Score filters
            'riskScore-greaterThan': z.number().optional().describe('Risk Score Greater Than (Only if includeRiskScore=true)'),
            'riskScore-equals': z.number().optional().describe('Risk Score Equals (Only if includeRiskScore=true)'),
            'riskScore-lessThan': z.number().optional().describe('Risk Score Less Than (Only if includeRiskScore=true)'),
        },
    },
  • Implements the execution logic for API tools like 'get-coins'. Handles path params, special param key replacement for '/coins' endpoint (MCP compatibility), API request via fetch, error handling, and MCP response formatting.
    export async function universalApiHandler<T>(
        basePath: string,
        endpoint: string,
        method: string = 'GET',
        params: Record<string, any> = {},
        body?: any
    ): Promise<{
        content: Array<{ type: 'text'; text: string; isError?: boolean }>;
    }> {
        try {
            // Handle path parameters - replace {paramName} in endpoint with actual values
            let processedEndpoint = endpoint;
            let processedParams = { ...params };
    
            // Find all path parameters in the endpoint (e.g., {coinId}, {id}, {type})
            const pathParamMatches = endpoint.match(/\{([^}]+)\}/g);
    
            if (pathParamMatches) {
                for (const match of pathParamMatches) {
                    const paramName = match.slice(1, -1); // Remove { and }
    
                    if (processedParams[paramName] !== undefined) {
                        // Replace the placeholder with the actual value
                        processedEndpoint = processedEndpoint.replace(match, processedParams[paramName]);
                        // Remove the parameter from query params since it's now part of the path
                        delete processedParams[paramName];
                    } else {
                        throw new Error(`Required path parameter '${paramName}' is missing`);
                    }
                }
            }
    
            // MCP clients might not support '~' in parameter names, so we replace '-' with '~' specifically for the /coins endpoint before making the request.
            if (endpoint === '/coins') {
                processedParams = Object.entries(processedParams).reduce((acc, [key, value]) => {
                    acc[key.replace(/-/g, '~')] = value;
                    return acc;
                }, {} as Record<string, any>);
            }
    
            const url = `${basePath}${processedEndpoint}`;
            const data = await makeRequestCsApi<T>(url, method, processedParams, body);
    
            if (!data) {
                return {
                    content: [{ type: 'text', text: 'Something went wrong', isError: true }],
                };
            }
    
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify(data),
                    },
                ],
            };
        } catch (error) {
            return {
                content: [{ type: 'text', text: `Error: ${error}`, isError: true }],
            };
        }
    }
  • Registers the 'get-coins' tool (and others) with the MCP server by calling server.tool with name, description, schema, and generic handler function.
    export function registerTools(server: McpServer, toolConfigs: ToolConfig<any>[]) {
        toolConfigs.forEach((config) => {
            server.tool(config.name, config.description, config.parameters, async (params: Record<string, any>) => {
                // Handle local operations
                if (config.isLocal) {
                    // Handle specific local tools
                    if (config.name === 'save-share-token') {
                        await saveToCache('shareToken', params.shareToken);
                        return {
                            content: [
                                {
                                    type: 'text',
                                    text: 'Share token saved successfully',
                                },
                            ],
                        };
                    }
    
                    if (config.name === 'get-share-token') {
                        const shareToken = await getFromCache('shareToken');
    
                        return {
                            content: [
                                {
                                    type: 'text',
                                    text: shareToken ? shareToken : 'No share token found in cache',
                                    isError: !shareToken,
                                },
                            ],
                        };
                    }
                    // Future local tools can be added here
    
                    // Default response for unhandled local tools
                    return {
                        content: [
                            {
                                type: 'text',
                                text: 'Operation completed',
                            },
                        ],
                    };
                }
    
                // Handle API operations
                const basePath = config.basePath || COINSTATS_API_BASE;
                const method = config.method || 'GET';
    
                // Methods that typically have a request body
                const bodyMethods = ['POST', 'PUT', 'PATCH', 'DELETE'];
    
                // For GET/DELETE requests, all params go in the URL
                // For POST/PUT/PATCH, send params as the body
                if (bodyMethods.includes(method.toUpperCase())) {
                    return universalApiHandler(basePath, config.endpoint, method, {}, params);
                } else {
                    return universalApiHandler(basePath, config.endpoint, method, params);
                }
            });
        });
    }
  • src/index.ts:17-18 (registration)
    Calls registerTools to register all tools including 'get-coins' on the MCP server instance.
    // Register all tools from configurations
    registerTools(server, allToolConfigs);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions what data is returned, it doesn't address critical behavioral aspects like pagination behavior (implied by page/limit parameters but not explained), rate limits, authentication requirements, data freshness, or error conditions. The description is purely functional without operational context.

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 efficiently structured in a single sentence listing data categories, though it could be slightly more front-loaded. It avoids redundancy and each clause adds value. However, it's somewhat dense with multiple data points listed without clear grouping.

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

Completeness2/5

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

For a tool with 43 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the paginated nature of results, how filtering parameters interact, what the response structure looks like, or operational constraints. The complexity of the tool demands more comprehensive guidance than provided.

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 documents all 43 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. It mentions general data categories but doesn't explain parameter relationships or usage patterns. Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'Get comprehensive data about all cryptocurrencies' with specific data types listed (price, market cap, volume, etc.). It uses a specific verb ('Get') and resource ('cryptocurrencies'), but doesn't explicitly differentiate from sibling tools like 'get-coin-by-id' or 'get-coin-avg-price', which would require a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools available (like 'get-coin-by-id' for specific coins or 'get-coin-avg-price' for price averages), there's no indication of when this comprehensive listing tool is appropriate versus more targeted options.

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/CoinStatsHQ/coinstats-mcp'

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