Skip to main content
Glama

market_cap

Retrieve cryptocurrency market capitalization rankings with prices, volumes, and 24-hour changes to analyze market trends and asset performance.

Instructions

Get top cryptocurrencies ranked by market cap with prices, volumes, and 24h changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of coins to return (default: 20, max: 100)

Implementation Reference

  • The `getMarketCap` function fetches top cryptocurrencies by market cap from the CoinGecko API.
    async function getMarketCap(limit = 20) {
      const data = await fetch(
        `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=${limit}&page=1&sparkline=false`
      );
      return data.map((c, i) => ({
        rank: i + 1,
        symbol: c.symbol.toUpperCase(),
        name: c.name,
        price: c.current_price,
        market_cap: c.market_cap,
        volume_24h: c.total_volume,
        change_24h: c.price_change_percentage_24h,
      }));
    }
  • index.js:273-281 (registration)
    The `market_cap` tool is defined in the `getToolDefinitions` method of the `MCPMarketServer` class.
      name: 'market_cap',
      description: 'Get top cryptocurrencies ranked by market cap with prices, volumes, and 24h changes.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: 'Number of coins to return (default: 20, max: 100)' }
        }
      }
    },
  • The `handleToolCall` method handles the `market_cap` tool invocation by calling `getMarketCap`.
    case 'market_cap':
      return await getMarketCap(Math.min(args.limit || 20, 100));
Behavior3/5

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

No annotations provided, so description carries full burden. Partially compensates by disclosing returned data fields (prices, volumes, 24h changes), but omits other behavioral traits like data freshness, rate limits, or caching behavior.

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?

Single efficient sentence with zero waste. Front-loaded with action verb and immediately specifies what is returned. Every word earns its place.

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

Completeness4/5

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

Adequate for a simple single-parameter tool. Without output schema, description partially compensates by listing return fields (prices, volumes, 24h changes). Could improve by noting if data is real-time or delayed, but sufficient for invocation.

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 has 100% description coverage for the single 'limit' parameter, establishing baseline of 3. Description adds no parameter-specific guidance (e.g., when to adjust limit from default), but none needed given complete schema documentation.

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' with specific resource 'top cryptocurrencies' and ranking criteria 'by market cap'. Implicitly distinguishes from siblings like 'trending' or 'price' by specifying market cap ranking, though could explicitly contrast with alternatives.

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 'trending', 'price', or 'compare'. Missing criteria for selecting this tool over alternatives that also provide cryptocurrency data.

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