Skip to main content
Glama

RiskModels Cohort Statistics

riskmodels_get_cohorts
Read-only

Retrieve cross-sectional residual statistics for SPY and the 11 GICS sector SPDR cohorts on one date or as a time series to compare sector risk.

Instructions

Use when you want cross-sectional residual statistics for SPY and the 11 GICS sector SPDR cohorts, on one date or as a time series. Not for one stock's peers (use riskmodels_get_peers) or one stock's rank (use riskmodels_get_rankings). Returns, from GET /cohorts (one date) or GET /cohorts/series (series=true), residual_mean, residual_sd, mean_pairwise_corr, n_names and n_effective by default, more on request. ERM3 residuals are fitted without an intercept, so residual_mean is not zero; link_fit_resid_sd is the residual standard deviation of the 252-day link regression, a fit-quality measure rather than a standard error. Subsector cohorts are not available. End-of-day data, refreshed after each US market close. Price: $0.04 for one date, $0.15 for a series.

Input Schema

NameRequiredDescriptionDefault
teoNoObservation date for the one-date view (default latest), format YYYY-MM-DD, e.g. 2026-06-30
seriesNotrue returns a time series over start_date..end_date, e.g. true (default false: one date)
cohortsNoComma-separated cohort tickers from SPY, XLE, XLB, XLI, XLY, XLP, XLV, XLF, XLK, XLC, XLU, XLRE, e.g. "SPY,XLK" (default all)
end_dateNoSeries end, series=true only, format YYYY-MM-DD, e.g. 2026-06-30
min_namesNoDrop cohorts or days with fewer members, integer, e.g. 20
variablesNoComma-separated variables, e.g. "residual_sd,n_names" (default residual_mean, residual_sd, mean_pairwise_corr, n_names, n_effective)
start_dateNoSeries start, series=true only, format YYYY-MM-DD, e.g. 2025-01-02

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.0.12
    • changedInput schema / properties / cohorts / description
      Previous value: -"Comma-separated cohort tickers (SPY, XLE, XLB, XLI, XLY, XLP, XLV, XLF, XLK, XLC, XLU, XLRE). Default: all"New value: +"Comma-separated cohort tickers from SPY, XLE, XLB, XLI, XLY, XLP, XLV, XLF, XLK, XLC, XLU, XLRE, e.g. \"SPY,XLK\" (default all)"
    • changedInput schema / properties / end_date / description
      Previous value: -"Series window end YYYY-MM-DD (series=true only)"New value: +"Series end, series=true only, format YYYY-MM-DD, e.g. 2026-06-30"
    • addedInput schema / properties / end_date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • changedInput schema / properties / min_names / description
      Previous value: -"Drop cohorts/days below this member count — their statistics are noise"New value: +"Drop cohorts or days with fewer members, integer, e.g. 20"
    • changedInput schema / properties / series / description
      Previous value: -"If true, return a time series over start_date..end_date instead of a one-date cross-section"New value: +"true returns a time series over start_date..end_date, e.g. true (default false: one date)"
    • changedInput schema / properties / start_date / description
      Previous value: -"Series window start YYYY-MM-DD (series=true only)"New value: +"Series start, series=true only, format YYYY-MM-DD, e.g. 2025-01-02"
    • addedInput schema / properties / start_date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • changedInput schema / properties / teo / description
      Previous value: -"Observation date YYYY-MM-DD for the cross-section (default latest)"New value: +"Observation date for the one-date view (default latest), format YYYY-MM-DD, e.g. 2026-06-30"
    • addedInput schema / properties / teo / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • changedInput schema / properties / variables / description
      Previous value: -"Comma-separated variables. Default: residual_mean, residual_sd, mean_pairwise_corr, n_names, n_effective"New value: +"Comma-separated variables, e.g. \"residual_sd,n_names\" (default residual_mean, residual_sd, mean_pairwise_corr, n_names, n_effective)"
  2. First observedv1.0.11

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly, non-destructive, open-world), yet the description goes well beyond: it discloses that ERM3 residuals are fitted without an intercept so residual_mean is non-zero, explains link_fit_resid_sd as a fit-quality measure rather than a standard error, states that subsector cohorts are unavailable, notes EOD refresh timing, and lists per-call pricing. This is exactly the extra context annotations cannot carry.

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?

Dense but front-loaded: routing guidance comes first, then return shape, then caveats and pricing. Every sentence carries information, though the residual-fitting and fit-quality caveats make it a long single block that could be slightly more scannable.

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?

Although there is no output schema, the description enumerates the default return fields (residual_mean, residual_sd, mean_pairwise_corr, n_names, n_effective) and signals more are available, plus the endpoints, data-freshness cadence, and cost. An agent has everything needed to call and interpret the result.

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 coverage is 100% so the baseline is 3, but the description adds real semantic value: it maps series=true to the /cohorts/series endpoint versus /cohorts for one date, notes that the returned variable set is a default 'more on request', and introduces link_fit_resid_sd as a valid variable. These details go beyond the schema's per-field docs.

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?

States a specific verb+resource (cross-sectional residual statistics for SPY and the 11 GICS sector SPDR cohorts) and immediately scopes it against the two nearest siblings by name. An agent can distinguish it from get_peers and get_rankings without opening any schema.

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?

Opens with an explicit 'Use when' condition and follows with negative routing — 'Not for one stock's peers (use riskmodels_get_peers) or one stock's rank (use riskmodels_get_rankings)'. Both the trigger and the alternatives are named, leaving nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.