Skip to main content
Glama

RiskModels Macro Factor Correlation

riskmodels_get_macro_correlation
Read-only

Measure how a stock's returns co-move with macro factors like rates, credit, oil, the dollar, or volatility using Pearson or Spearman correlations over a trailing window.

Instructions

Use when you want to know how one stock's returns co-move with macro factors such as rates, credit, oil, the dollar or volatility. Not for the macro factor return series themselves (use riskmodels_get_factor_returns). Returns, from POST /correlation, Pearson or Spearman correlations over a trailing window, using the L3 residual return by default. End-of-day data, refreshed after each US market close. Price: $0.01 per call.

Input Schema

NameRequiredDescriptionDefault
methodNo"pearson" or "spearman", e.g. "spearman" (default "pearson")
tickerYesUS stock ticker symbol, case-insensitive, e.g. NVDA
factorsNoMacro factor keys, e.g. ["oil","usd","term_spread"] (default: the standard set)
return_typeNoReturn series to correlate, e.g. "gross" (default "l3_residual")
window_daysNoTrailing window in trading days, integer, e.g. 126 (default 252)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.0.12
    • changedInput schema / properties / factors / description
      Previous value: -"Macro factor ids to test (default: standard set)"New value: +"Macro factor keys, e.g. [\"oil\",\"usd\",\"term_spread\"] (default: the standard set)"
    • changedInput schema / properties / method / description
      Previous value: -"\"pearson\" (default) or \"spearman\""New value: +"\"pearson\" or \"spearman\", e.g. \"spearman\" (default \"pearson\")"
    • changedInput schema / properties / return_type / description
      Previous value: -"Return series to correlate (default \"l3_residual\")"New value: +"Return series to correlate, e.g. \"gross\" (default \"l3_residual\")"
    • changedInput schema / properties / ticker / description
      Previous value: -"Ticker symbol, e.g. NVDA"New value: +"US stock ticker symbol, case-insensitive, e.g. NVDA"
    • changedInput schema / properties / window_days / description
      Previous value: -"Rolling window in days (default 252)"New value: +"Trailing window in trading days, integer, e.g. 126 (default 252)"
  2. First observedv1.0.11

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly, openWorld, non-destructive). The description adds meaningful behavior beyond them: the underlying endpoint (POST /correlation), default return basis (L3 residual), data freshness (end-of-day, refreshed after US close), and cost ($0.01 per call). Cost and latency signals are especially valuable and absent from structured fields.

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?

Front-loads the 'Use when' trigger, then the exclusion, then return/methodology, then freshness and price. Four sentences with no filler; each carries distinct, useful information.

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?

Given no output schema, the description conveys what is returned (correlations over a trailing window, method and return basis) plus cost and freshness. It stops short of describing the response shape (e.g., per-factor mapping), which is a minor gap for a no-output-schema tool.

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 description coverage is 100%, so method, ticker, factors, return_type, and window_days are already well documented. The description restates default behavior ('L3 residual return by default', 'Pearson or Spearman') which corroborates but does not extend the schema. Baseline 3 is appropriate.

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 purpose with verb-resource-scope: 'how one stock's returns co-move with macro factors such as rates, credit, oil, the dollar or volatility.' It explicitly names the sibling it is not (riskmodels_get_factor_returns), so an agent can select correctly without opening either 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 a clear exclusion ('Not for the macro factor return series themselves') plus the alternative tool to use instead. Both when-to-use and when-not are covered.

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