Skip to main content
Glama

get_asset_context

Analyze crypto assets by retrieving cycle position, price trends, volume health, holder behavior, risk levels, and positioning guidance for informed trading decisions.

Instructions

Get deep context on a specific crypto asset: cycle position, price trend, volume health, holder behavior, risk level, and positioning guidance. Pass asset name or symbol (e.g., "bitcoin", "btc", "ethereum", "sol").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYesAsset name or symbol (e.g., "bitcoin", "btc", "ethereum", "sol")

Implementation Reference

  • Main handler function for get_asset_context that resolves Coingecko IDs, retrieves market and chart data, calculates cycles and risks, and returns the asset context.
    export async function getAssetContext(cache: CacheService, asset: string): Promise<AssetContextOutput | ErrorOutput> {
      const coingeckoId = resolveCoingeckoId(asset);
      const cacheKey = `asset_context_${coingeckoId}`;
      const cached = cache.get<AssetContextOutput>(cacheKey);
      if (cached) return cached.data;
    
      try {
        const [coinData, chartData] = await Promise.all([
          getCoinMarket(coingeckoId),
          getMarketChart(coingeckoId, 90),
        ]);
    
        const prices = chartData.prices.map(p => p[1]);
        const volumes = chartData.total_volumes.map(v => v[1]);
    
        const sma30 = calculateSMA(prices, 30);
        const sma90 = calculateSMA(prices, prices.length);
        const recentHigh = Math.max(...prices.slice(-30));
        const volumeTrend = determineVolumeTrend(volumes);
    
        const cyclePosition = determineCyclePosition({
          currentPrice: coinData.current_price,
          sma30,
          sma90,
          recentHigh,
          volumeTrend,
        });
    
        const priceTrend = determinePriceTrend(prices);
        const avg30dVolume = volumes.slice(-30).reduce((a, b) => a + b, 0) / Math.min(volumes.length, 30);
        const volumeHealth = determineVolumeHealth(coinData.total_volume, avg30dVolume);
        const volumeVs30d = avg30dVolume > 0 ? Math.round((coinData.total_volume / avg30dVolume) * 100) / 100 : 1;
    
        const riskLevel = assessRiskLevel(cyclePosition, priceTrend, volumeHealth, coinData.ath_change_percentage);
        const holderBehavior = assessHolderBehavior(cyclePosition, volumeTrend, priceTrend);
        const guidance = generateAssetGuidance(coinData.name, cyclePosition, priceTrend, riskLevel, volumeHealth, coinData.ath_change_percentage);
    
        const result: AssetContextOutput = {
          asset: coinData.name,
          coingecko_id: coingeckoId,
          price_usd: coinData.current_price,
          market_cap_usd: coinData.market_cap,
          volume_24h: coinData.total_volume,
          cycle_position: cyclePosition,
          vs_ath_percentage: Math.round(coinData.ath_change_percentage * 100) / 100,
          vs_atl_percentage: Math.round(coinData.atl_change_percentage * 100) / 100,
          volume_health: volumeHealth,
          volume_vs_30d_average: volumeVs30d,
          price_trend: priceTrend,
          holder_behavior: holderBehavior,
          risk_level: riskLevel,
          agent_guidance: guidance,
        };
    
        cache.set(cacheKey, result, getCacheTtl(BASE_TTL));
        return result;
      } catch (err) {
        return {
          error: true,
          error_source: 'get_asset_context',
          agent_guidance: 'Asset data unavailable. Do not make positioning decisions on this asset until data is restored. If this is a new or low-cap asset, it may not be indexed.',
          last_known_data: cache.get<AssetContextOutput>(cacheKey)?.data ?? null,
          data_warnings: ['Asset data source temporarily unavailable. Verify the asset name or symbol and retry.'],
        };
      }
    }
Behavior3/5

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

No annotations provided, so description carries full disclosure burden. It transparently lists what data aspects are returned (behavioral output characteristics), but lacks operational details such as data freshness, caching behavior, rate limits, or whether this requires specific permissions/tiers.

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?

Two sentences with zero waste: first establishes value proposition and return data scope, second provides input instruction with concrete examples. Appropriately front-loaded and sized for the tool's complexity.

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?

Without an output schema, the description adequately compensates by enumerating the six analytical dimensions returned. Given the single simple input parameter and the richness of the described output, this is complete enough, though mentioning return format (object vs text) would elevate it further.

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 coverage is 100% with the 'asset' parameter fully documented. Description echoes the schema's example values ('bitcoin', 'btc') without adding syntactic constraints, validation rules, or semantic distinctions between name vs symbol resolution. Meets baseline expectations when schema is self-explanatory.

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?

States specific verb+resource ('Get deep context' on 'crypto asset') and lists six distinct analytical aspects returned (cycle position, price trend, volume health, holder behavior, risk level, positioning guidance). However, it does not explicitly differentiate from siblings like get_asset_momentum or get_onchain_pulse, leaving ambiguity about why to choose this comprehensive tool over specialized alternatives.

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?

Provides no explicit when-to-use or when-not-to-use relative to siblings, nor mentions prerequisites. However, the exhaustive list of analytical aspects implicitly signals this is the comprehensive asset analysis tool vs. single-metric alternatives, meeting the threshold for implied usage guidance.

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