Skip to main content
Glama

get_market_regime

Identify current crypto market regimes (risk-on, risk-off, etc.) with confidence scores, evidence, and actionable guidance to inform trading decisions.

Instructions

Classify the current crypto market regime (risk-on, risk-off, transitional, euphoric, capitulation) with confidence score, evidence, historical analog, and actionable agent guidance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the get_market_regime tool. It fetches market data, classifies the regime, and generates guidance based on the current market state.
    export async function getMarketRegime(cache: CacheService): Promise<MarketRegimeOutput | ErrorOutput> {
      const cached = cache.get<MarketRegimeOutput>(CACHE_KEY);
      if (cached) return cached.data;
    
      try {
        const [globalData, fgData] = await Promise.all([
          getGlobalData(),
          getFearGreed(7),
        ]);
    
        const fearGreed = parseInt(fgData.data[0].value, 10);
        const btcDominance = globalData.data.market_cap_percentage['btc'] ?? 0;
        const marketCapChange24h = globalData.data.market_cap_change_percentage_24h_usd;
        const totalMarketCap = globalData.data.total_market_cap['usd'] ?? 0;
    
        const { regime, confidence, evidence } = classifyRegime({
          fearGreed,
          btcDominance,
          marketCapChange24h,
        });
    
        const btcDominanceTrend = getBtcDominanceTrend(btcDominance);
    
        const historicalAnalog = matchHistoricalAnalog({
          regime,
          fearGreed,
          btcDominanceTrend,
        });
    
        const guidance = generateRegimeGuidance(regime, fearGreed, confidence, btcDominanceTrend);
    
        const result: MarketRegimeOutput = {
          regime,
          confidence,
          evidence,
          historical_analog: historicalAnalog,
          fear_greed_score: fearGreed,
          fear_greed_label: getFearGreedLabel(fearGreed),
          btc_dominance: Math.round(btcDominance * 100) / 100,
          btc_dominance_trend: btcDominanceTrend,
          total_market_cap_usd: totalMarketCap,
          market_cap_change_24h: Math.round(marketCapChange24h * 100) / 100,
          agent_guidance: guidance,
        };
    
        cache.set(CACHE_KEY, result, getCacheTtl(BASE_TTL));
        return result;
      } catch (err) {
        return {
          error: true,
          error_source: 'get_market_regime',
          agent_guidance: 'Market regime data unavailable. Fathom recommends delaying financially consequential decisions until data is restored. Treat current conditions as high-uncertainty.',
          last_known_data: cache.get<MarketRegimeOutput>(CACHE_KEY)?.data ?? null,
          data_warnings: ['Market regime data source temporarily unavailable. Retry shortly.'],
        };
      }
    }
Behavior4/5

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

Without annotations, description carries full disclosure burden and succeeds by detailing the analytical methodology (classification with confidence scoring) and specific output components (evidence, historical analog, actionable guidance). Lacks operational details like rate limits or latency, but clearly establishes this as an analytical inference tool rather than simple data retrieval.

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 dense sentence of ~25 words with zero waste. Front-loaded with specific regime taxonomy followed by comma-separated output descriptors. Every clause conveys essential information about capability and return structure.

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

Completeness5/5

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

Excellent coverage for a parameter-less tool with no output schema. Compensates for missing output schema by explicitly enumerating return components (confidence score, evidence, historical analog, guidance), fully preparing the agent for the structured analytical response.

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?

Zero parameters present, warranting baseline score of 4 per rubric. Schema is empty object with no fields requiring semantic elaboration.

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?

Specific verb 'Classify' paired with clear resource 'crypto market regime' and detailed scope including five distinct regime types (risk-on, risk-off, transitional, euphoric, capitulation). Distinguishes from siblings like get_macro_context or get_sentiment_state by focusing specifically on regime classification with multi-factor evidence.

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?

Implies usage context through specificity of regime classification framework, but lacks explicit when-to-use guidance versus alternatives like get_macro_context or get_alternative_signals. No mention of prerequisites or conditions that would trigger selecting this over sibling analysis tools.

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/0xHashy/fathom-fyi'

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