Skip to main content
Glama
kukapay

crypto-feargreed-mcp

analyze_fng_trend

Analyze Crypto Fear & Greed Index trends over a specified period to identify market sentiment patterns and direction.

Instructions

Analyze trends in Crypto Fear & Greed Index over specified days.

Parameters: days (int): Number of days to analyze (must be a positive integer).

Returns: str: A string containing the analysis results, including latest value, average value, trend direction, and number of data points analyzed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYes

Implementation Reference

  • main.py:85-129 (handler)
    The main handler function for the 'analyze_fng_trend' tool. It fetches historical Fear & Greed Index data for the specified number of days, computes statistics like average value and trend direction, and returns a formatted analysis string.
    async def analyze_fng_trend(days: int, ctx: Context) -> str:
        """
        Analyze trends in Crypto Fear & Greed Index over specified days.
    
        Parameters:
            days (int): Number of days to analyze (must be a positive integer).
    
        Returns:
            str: A string containing the analysis results, including latest value,
                 average value, trend direction, and number of data points analyzed.
        """
        if days <= 0:
            return "Error: Days must be a positive integer"
        
        ctx.info(f"Fetching {days} days of FNG data")
        try:
            async with httpx.AsyncClient() as client:
                response = await client.get(API_URL, params={"limit": days})
                response.raise_for_status()
                data = response.json()["data"]
                
                if not data:
                    return "Error: No data available"
                    
                values = [int(entry["value"]) for entry in data]
                total_entries = len(values)
                
                # Calculate statistics
                avg = sum(values) / total_entries
                trend = "rising" if values[0] > values[-1] else "falling" if values[0] < values[-1] else "stable"
                latest = data[0]  # Most recent entry            
                
                result = [
                    f"Fear & Greed Index Analysis ({days} days):",
                    f"Latest Value: {latest['value']} ({latest['value_classification']}) "
                    f"at {datetime.fromtimestamp(int(latest['timestamp']))} UTC",
                    f"Average Value: {avg:.1f}",
                    f"Trend: {trend}",
                    f"Data points analyzed: {total_entries}"
                ]
                return "\n".join(result)
        except httpx.HTTPStatusError as e:
            return f"Error fetching data: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • main.py:85-85 (registration)
    The @mcp.tool() decorator registers the 'analyze_fng_trend' function as an MCP tool.
    async def analyze_fng_trend(days: int, ctx: Context) -> str:
  • main.py:86-95 (schema)
    The docstring provides the input schema (days: int) and output description for the tool.
    """
    Analyze trends in Crypto Fear & Greed Index over specified days.
    
    Parameters:
        days (int): Number of days to analyze (must be a positive integer).
    
    Returns:
        str: A string containing the analysis results, including latest value,
             average value, trend direction, and number of data points analyzed.
    """
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool's function and return format, including details like 'latest value, average value, trend direction, and number of data points analyzed.' However, it lacks information on potential limitations (e.g., rate limits, data availability, error conditions) or performance characteristics. The description adds value but isn't comprehensive for behavioral transparency.

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?

The description is well-structured and appropriately sized. It starts with a clear purpose statement, followed by a 'Parameters' section with a concise explanation, and a 'Returns' section detailing the output. Every sentence adds value without redundancy, making it easy for an agent to parse and understand.

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?

Given the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is fairly complete. It covers the purpose, parameter semantics, and return format in detail. However, it lacks context on how it differs from sibling tools and doesn't mention potential behavioral aspects like error handling or data sources, leaving some gaps for the agent.

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

Parameters4/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that 'days' is 'Number of days to analyze (must be a positive integer),' clarifying the parameter's purpose and constraints. This compensates well for the schema's lack of documentation, though it doesn't cover edge cases like maximum allowed days.

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: 'Analyze trends in Crypto Fear & Greed Index over specified days.' It specifies the verb ('analyze trends'), resource ('Crypto Fear & Greed Index'), and scope ('over specified days'). However, it doesn't explicitly differentiate from sibling tools like 'get_current_fng_tool' or 'get_historical_fng_tool', which likely provide raw data rather than analysis.

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 its siblings ('get_current_fng_tool' and 'get_historical_fng_tool'). It mentions the parameter 'days' but doesn't explain alternative scenarios or prerequisites. Without explicit when/when-not instructions, the agent must infer usage from the purpose alone.

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/kukapay/crypto-feargreed-mcp'

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