Skip to main content
Glama
kukapay

crypto-pegmon-mcp

analyze_peg_stability

Assess the stability of USD-pegged stablecoins by generating a detailed Markdown report with historical data, current price, and analysis over a specified time period.

Instructions

Generate a peg stability analysis report for a USD-pegged stablecoin.

Args:
    coin (str): The symbol of the stablecoin (e.g., 'usdt', 'usdc', 'dai').
    days (int, optional): Number of days for analysis. Defaults to 7.

Returns:
    str: A Markdown-formatted report with historical data, current price, and stability analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYes
daysNo

Implementation Reference

  • main.py:163-199 (handler)
    The handler function for the 'analyze_peg_stability' tool. It is decorated with @mcp.tool(), which also serves as the registration. The function fetches historical price data, computes deviations from $1 peg, determines stability status, and returns a formatted Markdown report.
    @mcp.tool()
    def analyze_peg_stability(coin: str, days: int = 7) -> str:
        """
        Generate a peg stability analysis report for a USD-pegged stablecoin.
    
        Args:
            coin (str): The symbol of the stablecoin (e.g., 'usdt', 'usdc', 'dai').
            days (int, optional): Number of days for analysis. Defaults to 7.
    
        Returns:
            str: A Markdown-formatted report with historical data, current price, and stability analysis.
        """
        if coin.lower() not in STABLECOINS:
            return f"Error: Unsupported stablecoin. Choose from {list(STABLECOINS.keys())}"
        
        historical_data = get_historical_data(coin, days)
        current_price = get_current_price(coin)
        
        try:
            df = pd.read_json(json.dumps(cg.get_coin_market_chart_by_id(
                id=STABLECOINS[coin.lower()]["id"], vs_currency="usd", days=days)["prices"]))
            df.columns = ["Timestamp", "Price"]
            df["Deviation"] = (df["Price"] - 1.0) * 100
            max_deviation = df["Deviation"].abs().max()
            stability_note = "Stable" if max_deviation < 1.0 else "Unstable" if max_deviation > 3.0 else "Moderately Stable"
            
            return (
                f"**Peg Stability Analysis for {coin.upper()} (Last {days} Days)**:\n\n"
                f"{historical_data}\n\n"
                f"{current_price}\n\n"
                f"**Analysis**:\n"
                f"- Maximum Deviation: {max_deviation:.2f}%\n"
                f"- Stability Status: {stability_note}\n"
                f"- Note: Deviations > 3% indicate potential depegging risks."
            )
        except Exception as e:
            return f"Error in analysis for {coin}: {str(e)}"
Behavior2/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 mentions generating a report with 'historical data, current price, and stability analysis,' which gives some context on output content, but lacks details on behavioral traits such as data sources, rate limits, error handling, or whether it performs computations or fetches external data. This leaves gaps for an AI agent to understand operational aspects.

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 appropriately sized and front-loaded: it starts with the core purpose, followed by structured sections for 'Args' and 'Returns.' Each sentence adds value without redundancy, making it easy to scan and understand quickly. No wasted words or unnecessary details are present.

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?

Given the tool's complexity (analysis report generation) and lack of annotations and output schema, the description is moderately complete. It covers the purpose, parameters, and return format (Markdown report), but lacks details on behavioral aspects like data freshness, accuracy, or potential limitations. For a tool with no structured output schema, more context on report structure or analysis methods would enhance completeness.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics beyond the schema by explaining 'coin' as 'The symbol of the stablecoin (e.g., 'usdt', 'usdc', 'dai')' and 'days' as 'Number of days for analysis. Defaults to 7,' including an example and default value. This clarifies parameter usage effectively, though it could provide more on constraints or validation.

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: 'Generate a peg stability analysis report for a USD-pegged stablecoin.' It specifies the verb ('generate'), resource ('report'), and scope ('USD-pegged stablecoin'), but does not explicitly differentiate it from sibling tools like 'get_historical_data' or 'get_current_price' which might provide related data without analysis.

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 implies usage by specifying the type of analysis ('peg stability analysis report') and the target ('USD-pegged stablecoin'), suggesting it's for evaluating stablecoin performance. However, it does not provide explicit guidance on when to use this tool versus alternatives like 'get_historical_data' or 'get_current_price', nor does it mention prerequisites or exclusions.

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

Related 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-pegmon-mcp'

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