Skip to main content
Glama

Hero Metric

render_hero_metric
Read-onlyIdempotent

Render a hero metric widget with variants to answer key business questions: big number, progress ring, status, comparison, rank, countdown, threshold, breakdown, NPS, orb, and gem.

Instructions

Render a purpose-driven hero metric widget. Pick the variant that answers your question:

  • big_number: 'How much? Which direction?' Default hero metric - clean, professional, works in any context. Large value + trend arrow + optional sparkline. Params: value, unit, change, changePeriod, sparkline[]

  • progress_ring: 'How close to goal?' Animated ring or half-gauge. Params: value, unit, label, progress (0-100), style ('ring'|'gauge'), size, color

  • status: 'Good or bad?' Pulsing dot + subsystem badges. Params: label, statusLevel ('good'|'warn'|'bad'), subsystems[{name,status}], count, peak

  • comparison: 'How do we compare?' Before/after + improvement. Params: before, after, improvement, beforeLabel, afterLabel

  • rank: 'Where do I stand?' Badge + percentile. Params: rank, total, percentile, rankChange

  • countdown: 'How long left?' Time segment boxes. Params: segments[{value,label}] OR deadline (ISO date)

  • threshold: 'Above or below limit?' Gradient bar + marker. Params: value, max, threshold, unit, zones[{label,from,to,color}]

  • breakdown: 'What is the split?' Stacked bar + legend. Params: items[{label,value,color?}]

  • nps: 'How satisfied?' Score + rating scale. Params: value, max (default 100), rating ('good'|'neutral'|'bad')

  • orb: 'What is the headline?' Dramatic glowing sphere. Use golden orb for resumes/portfolios. For tech meetings use only black, white, or crystal-colored orbs as subtle flair. Best with dark themes (tokyo-midnight, ops-control, startup). Avoid for formal contexts (boardroom, clinical, consultant). Params: value, unit, label, color

  • gem: 'Premium gem metric' Faceted/spherical gem - for wealth, fintech, trading, crypto, luxury contexts ONLY. Best with golden-treasury, tokyo-midnight themes. Do NOT use for corporate, clinical, consultant, or boardroom dashboards - use big_number instead. Params: value, unit, label, gemType. gemTypes: crystal='Future' (forecasts, projections) | black_pearl='Rare find' (alt investments, crypto) | golden_pearl='Treasure' (gold, commodities) | white_pearl='Clean total' (savings) diamond='Crown number' (net worth, total revenue) | ruby='What's critical' (urgent, burn rate) | sapphire='Foundation' (stability, uptime) | emerald='Growth' (YoY, appreciation)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesChart title
variantNoWidget variant (default: big_number)
valueNoMain metric value
unitNoUnit label (e.g. 'grams', '%', 'USD')
labelNoSub-label
colorNoOverride accent color (hex)
progressNoRing fill 0-100
sizeNoSize: sm/md/lg/xl
styleNoprogress_ring style
changeNoPercentage change
changePeriodNoPeriod label for change (e.g. 'vs last month')
sparklineNoMini bar sparkline data
statusLevelNoStatus level
subsystemsNoSubsystem badges
countNoLive count
peakNoPeak count
beforeNoBefore value
afterNoAfter value
improvementNoImprovement label
beforeLabelNoBefore column label
afterLabelNoAfter column label
rankNoCurrent rank
totalNoTotal in ranking
percentileNoPercentile
rankChangeNoPositions moved
segmentsNoTime segments
deadlineNoISO deadline date
maxNoMaximum value for threshold/nps
thresholdNoThreshold limit line
zonesNoColor zones
itemsNoBreakdown items
ratingNoNPS rating override
gemTypeNoGem type for variant=gem: diamond, ruby, sapphire, emerald, golden_pearl, white_pearl, black_pearl, crystal
themeNoTheme preset: boardroom, corporate, sales-floor, golden-treasury, clinical, startup, ops-control, tokyo-midnight, zen-garden, consultant, black-tron, black-elegance, black-matrix, forest-amber, forest-earth, sky-light, sky-ocean, sky-twilight, gray-hf, gray-copilot
paletteNoOverride palette only (mix-and-match)
typographyNoOverride typography: professional, luxury, cyberpunk, editorial, mono, bold, system, techno
effectsNoOverride effects: none, subtle, shimmer, neon, energetic

Implementation Reference

  • Main handler function for the render_hero_metric tool. Renders a hero metric card with theme support and delegates to renderHeroWidget for variant-specific content (big_number, progress_ring, status, comparison, rank, countdown, threshold, breakdown, nps, orb, gem). Also adds HTML export and refresh buttons.
    export function renderHeroMetric(container: HTMLElement, payload: HeroPayload): void {
      const theme = resolveTheme(payload.theme, {
        palette: payload.palette,
        typography: payload.typography,
        effects: payload.effects,
      });
      if (theme) applyTheme(container, theme);
    
      container.className = "chart-view";
      container.innerHTML = `
        <div class="card chart-card hero-metric">
          <div class="chart-card__header">
            <div>
              <div class="chart-card__title${theme?.effects.shimmerTitle ? " shimmer-text" : ""}">${escapeHtml(payload.title || "Metric")}</div>
            </div>
          </div>
          <div class="hero-metric__body"></div>
        </div>
      `;
    
      const body = container.querySelector<HTMLElement>(".hero-metric__body")!;
      renderHeroWidget(body, payload);
    
      const card = container.querySelector<HTMLElement>(".chart-card")!;
      addHtmlExportButton(card, payload.title || "hero-metric");
      addRefreshButton(card, () => {
        (window as any).__mcpRefresh?.();
      });
    }
  • HeroPayload interface defining the full input schema for render_hero_metric. Supports multiple variants: big_number, progress_ring, status, comparison, rank, countdown, threshold, breakdown, nps, orb, gem.
    interface HeroPayload {
      type: "hero_metric";
      variant?: HeroVariant;
      title?: string;
      theme?: string;
      palette?: string;
      typography?: string;
      effects?: string;
    
      // big_number
      value?: string | number;
      unit?: string;
      label?: string;
      change?: number;
      changePeriod?: string;
      sparkline?: number[];
    
      // progress_ring (absorbed speedometer)
      progress?: number;
      color?: string;
      size?: "sm" | "md" | "lg" | "xl";
      style?: "ring" | "gauge";
    
      // status (absorbed live_counter)
      statusLevel?: "good" | "warn" | "bad";
      subsystems?: Array<{ name: string; status: "good" | "warn" | "bad" }>;
      count?: number;
      peak?: number;
    
      // comparison
      before?: number | string;
      after?: number | string;
      improvement?: number | string;
      beforeLabel?: string;
      afterLabel?: string;
    
      // rank
      rank?: number;
      total?: number;
      percentile?: number;
      rankChange?: number;
    
      // countdown
      segments?: Array<{ value: number; label: string }>;
      deadline?: string;
    
      // threshold
      max?: number;
      threshold?: number;
      zones?: Array<{ label: string; from: number; to: number; color: string }>;
    
      // breakdown
      items?: Array<{ label: string; value: number; color?: string }>;
    
      // nps
      rating?: "good" | "neutral" | "bad";
    
      // orb (uses value, label, color)
    
      // events (for ticker - not used, kept for future)
      events?: Array<{ text: string; time?: string; type?: string }>;
    }
  • registerChart function that registers chart types with their tool names and render functions into a central registry.
    export function registerChart(
      type: string,
      toolName: string,
      render: (root: HTMLElement, data: any) => void,
    ): void {
      CHART_REGISTRY[type] = { toolName, render };
  • Registration call linking the chart type 'hero_metric' to the tool name 'render_hero_metric' and the renderHeroMetric handler function.
    registerChart("hero_metric", "render_hero_metric", renderHeroMetric);
  • renderHeroWidget helper function that routes to the correct variant renderer based on the payload variant field (big_number, progress_ring, status, comparison, rank, countdown, threshold, breakdown, nps, orb, gem).
    export function renderHeroWidget(body: HTMLElement, p: any): void {
      const variant = p.variant || "big_number";
      switch (variant) {
        case "big_number":
          renderBigNumber(body, p);
          break;
        case "progress_ring":
          renderHeroRing(body, {
            value: p.value ?? "",
            unit: p.unit,
            label: p.label,
            progress: p.progress,
            color: p.color,
            size: p.size,
            style: p.style,
          });
          break;
        case "status":
          renderStatus(body, p);
          break;
        case "comparison":
          renderComparison(body, p);
          break;
        case "rank":
          renderRank(body, p);
          break;
        case "countdown":
          renderCountdown(body, p);
          break;
        case "threshold":
          renderThreshold(body, p);
          break;
        case "breakdown":
          renderBreakdown(body, p);
          break;
        case "nps":
          renderNps(body, p);
          break;
        case "orb":
          renderOrb(body, p);
          break;
        case "gem":
          renderGem(body, p);
          break;
        default:
          renderBigNumber(body, p);
      }
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, covering the core behavioral profile. The description adds context on visual behavior (e.g., glowing orb, faceted gem) and thematic constraints, which is useful beyond annotations.

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 long but well-structured with a summary and variant-by-variant breakdown. Each section is front-loaded with its purpose. While verbose, every sentence is informative and earns its place.

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?

Given 37 parameters, no output schema, and multiple variants, the description covers all necessary contextual information: variant selection, parameter mapping, thematic recommendations, and even exclusions. It is thorough and leaves no major gaps.

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

Parameters5/5

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

Schema coverage is 100%, so baseline is 3. The description goes far beyond by detailing which parameters apply to each variant and how they control the output (e.g., 'big_number: Large value + trend arrow + optional sparkline. Params: value, unit, change, changePeriod, sparkline[]'). This adds rich semantic meaning.

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 'Render a purpose-driven hero metric widget' and lists specific variants each answering a distinct question. This distinguishes it from sibling chart tools like render_bar_chart or render_table, which are for different visualization types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance for each variant (e.g., 'progress_ring: How close to goal?'), including when not to use (e.g., for gem: 'Do NOT use for corporate... use big_number instead'). Alternatives are clearly named.

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/KyuRish/mcp-dashboards'

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