Skip to main content
Glama
grahammccain

Chart Library

Analytic Metrics

analyze
Read-onlyIdempotent

Analyze historical metrics on cohorts or symbol-date anchors: detect anomalies, volume profiles, crowding, correlation shifts, earnings reactions, and pattern degradation for actionable insights.

Instructions

Analytic metrics on a cohort or (symbol, date) anchor.

metric values:
  - "anomaly"             — is the pattern unusual vs the symbol's
                              own history? (needs symbol)
  - "volume_profile"      — intraday volume vs historical norms
                              (needs symbol)
  - "crowding"            — cross-symbol crowding indicator
                              (market-wide; no symbol needed)
  - "correlation_shift"   — rolling correlation breakdowns
                              (extra_args: lookback, window, symbols)
  - "earnings_reaction"   — historical earnings gap reactions
                              (needs symbol; extra_args: min_gap)
  - "pattern_degradation" — are signals losing edge vs historical
                              accuracy? (market-wide)
  - "regime_accuracy"     — win rates filtered by current regime
                              (needs symbol)
  - "decompose"           — find slice conditions that separated
                              winners from losers within a cohort
                              (needs cohort_id; horizon, max_slices,
                              explain_slices apply)
  - "clusters"            — cluster a cohort into k forward-return
                              groups (needs cohort_id; horizon, k)

Supply cohort_id (preferred, anchor inherited) OR explicit
symbol+date for the symbol-needing metrics.

Args:
    metric: see list above
    cohort_id: handle from `search` or `cohort` (required for
        decompose, clusters; preferred for symbol-needing metrics)
    symbol, date: explicit anchor when no cohort_id available
    extra_args: per-metric optional kwargs (see metric list)
    horizon: forward horizon in trading days (decompose, clusters,
        regime_accuracy)
    max_slices: max returned slice conditions (decompose)
    explain_slices: include Haiku narrative tying slices together
        (decompose)
    k: cluster count override (clusters; default chosen automatically)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYes
cohort_idNo
symbolNo
dateNo
extra_argsNo
horizonNo
max_slicesNo
explain_slicesNo
kNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnly, non-destructive, idempotent, and open-world hints. The description adds valuable behavioral context, such as the preferred use of cohort_id and the per-metric parameter needs. It does not mention output format (handled by output schema) or edge cases, but overall sufficiently complements the annotations.

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: a clear opening sentence, a bullet-list of metrics with needs, and a clean argument list. Every sentence adds value, and critical information is front-loaded. For a tool with 9 parameters and many metrics, this is an appropriate length with no wasted text.

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 the tool's complexity (9 parameters, various metrics, optional extra_args) and the presence of an output schema, the description is complete. It covers all metrics' prerequisites, parameter meanings, and the anchor vs cohort distinction. The output schema handles return format, so no further explanation needed.

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?

The input schema has 0% description coverage, so the description carries full burden. It explains every parameter in detail, especially the metric values (which are effectively enums but not in schema), the role of cohort_id versus symbol/date, extra_args per metric, and special parameters for decompose and clusters. This adds substantial meaning beyond the raw schema.

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 the tool provides analytic metrics on a cohort or anchor, and enumerates all specific metrics with their requirements. This differentiates it from sibling tools that are more specialized, though the description doesn't explicitly compare. The verb+resource combination is specific and unambiguous.

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

Usage Guidelines4/5

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

The description explains when to use cohort_id vs symbol+date, and which metrics need which parameters. It provides clear context but does not explicitly contrast with sibling tools like 'clusters' or 'decompose' that cover the same metrics. The guidance is thorough for the tool itself but lacks comparative direction.

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/grahammccain/chart-library-mcp'

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