Skip to main content
Glama

fearAndGreedHistorical

Retrieve historical Crypto Fear and Greed Index values from CoinMarketCap to analyze market sentiment over time.

Instructions

Returns historical CMC Crypto Fear and Greed Index values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startNo
limitNo

Implementation Reference

  • index.js:544-556 (registration)
    Registration of the 'fearAndGreedHistorical' tool on the McpServer with schema and handler.
    server.tool("fearAndGreedHistorical",
      "Returns historical CMC Crypto Fear and Greed Index values.",
      {
        start: z.number().min(1).optional(),
        limit: z.number().min(1).max(500).optional()
      },
      async (params) => {
        return handleEndpoint(async () => {
          const data = await makeApiRequest(apiKey, '/v3/fear-and-greed/historical', params)
          return formatResponse(data)
        })
      }
    )
  • Handler function that executes the tool logic: calls the /v3/fear-and-greed/historical endpoint via makeApiRequest and formats the response.
    async (params) => {
      return handleEndpoint(async () => {
        const data = await makeApiRequest(apiKey, '/v3/fear-and-greed/historical', params)
        return formatResponse(data)
      })
    }
  • Input schema for the tool: optional 'start' (number, min 1) and 'limit' (number, min 1, max 500) parameters.
    {
      start: z.number().min(1).optional(),
      limit: z.number().min(1).max(500).optional()
    },
  • Helper function 'makeApiRequest' that builds the URL and makes the GET request to the CoinMarketCap API with the given params.
    async function makeApiRequest(apiKey, endpoint, params = {}) {
      const queryParams = new URLSearchParams()
      Object.entries(params).forEach(([key, value]) => {
        if (value !== undefined) {
          queryParams.append(key, value.toString())
        }
      })
    
      const url = `https://pro-api.coinmarketcap.com${endpoint}${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
    
      const response = await fetch(url, {
        method: 'GET',
        headers: {
          'Accept': 'application/json',
          'X-CMC_PRO_API_KEY': apiKey,
        }
      })
    
      if (!response.ok) {
        throw new Error(`Error fetching data from CoinMarketCap: ${response.statusText}`)
      }
    
      return await response.json()
    }
  • Helper function 'handleEndpoint' that wraps the API call in try/catch for consistent error handling.
    async function handleEndpoint(apiCall) {
      try {
        return await apiCall()
      } catch (error) {
        return formatErrorResponse(error.message, error.status || 403)
      }
    }
Behavior2/5

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

No annotations are provided, so the description bears full responsibility. It only says 'returns historical values' without disclosing pagination, data frequency, rate limits, or the effect of start/limit parameters. This is insufficient for an API that likely has significant behavior.

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 a single sentence with no unnecessary words. It is concise, though it could benefit from slightly more detail without being verbose.

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?

Given no output schema and no annotations, the description fails to specify return format or data range. The limit parameter has a max of 500, but the description doesn't mention pagination or how to get more data. For a historical endpoint, this is incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain the start and limit parameters. It adds no meaning beyond the raw schema.

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 it returns historical values of the Fear and Greed Index, with a specific verb and resource. It distinguishes from the sibling fearAndGreedLatest, which likely returns latest values.

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?

Usage is implied by the name and sibling tool (fearAndGreedLatest for current values), but the description does not explicitly state when to use or avoid this tool, nor does it mention alternatives.

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

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