Skip to main content
Glama

RiskModels Selection vs Drift

riskmodels_decompose_selection_vs_drift
Read-only

Decompose a portfolio's realized residual return over a date window into stock selection and drift, separating name picking from cohort exposure.

Instructions

Use when you want a book's realized residual return over a date window attributed to stock selection versus drift. Not for current risk or hedges (use riskmodels_portfolio_exposure). Returns, from POST /cohorts/pnl-decomposition, selection (from holding names that beat their cohort's average residual) and drift (from net exposure to the cohort average), which sum exactly to the total; weights are held constant over the window and not normalized, a short is a negative weight, and positions that cannot be mapped to a cohort are listed in coverage.dropped. Historical attribution on end-of-day data. Price: $0.25 per call.

Input Schema

NameRequiredDescriptionDefault
levelNoCohort level, e.g. market (default sector)
end_dateNoWindow end, format YYYY-MM-DD, e.g. 2026-06-30
min_namesNoIgnore cohort means on days the cohort had fewer members, integer, e.g. 20
positionsYesThe book to attribute, 1-500 positions, e.g. [{"ticker":"MSFT","weight":0.1},{"ticker":"INTC","weight":-0.05}]
start_dateNoWindow start, format YYYY-MM-DD, e.g. 2026-01-02
include_seriesNotrue adds the daily selection and drift series (large), e.g. true (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.0.12
    • changedInput schema / properties / end_date / description
      Previous value: -"Window end YYYY-MM-DD"New value: +"Window end, 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 / include_series / description
      Previous value: -"Include the daily selection/drift series (bulky)"New value: +"true adds the daily selection and drift series (large), e.g. true (default false)"
    • changedInput schema / properties / level / description
      Previous value: -"Cascade level (default sector)"New value: +"Cohort level, e.g. market (default sector)"
    • changedInput schema / properties / min_names / description
      Previous value: -"Ignore cohort means on days the cohort was thinner than this"New value: +"Ignore cohort means on days the cohort had fewer members, integer, e.g. 20"
    • changedInput schema / properties / positions / description
      Previous value: -"The book to attribute"New value: +"The book to attribute, 1-500 positions, e.g. [{\"ticker\":\"MSFT\",\"weight\":0.1},{\"ticker\":\"INTC\",\"weight\":-0.05}]"
    • addedInput schema / properties / positions / items / properties / ticker / description
      Added value: +"US stock ticker symbol, e.g. MSFT"
    • changedInput schema / properties / positions / items / properties / weight / description
      Previous value: -"Portfolio weight; negative for a short"New value: +"Portfolio weight as a decimal, negative for a short, e.g. -0.05"
    • changedInput schema / properties / start_date / description
      Previous value: -"Window start YYYY-MM-DD"New value: +"Window start, format YYYY-MM-DD, e.g. 2026-01-02"
    • addedInput schema / properties / start_date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
  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?

Beyond the annotations (which already convey read-only, non-destructive, open-world), the description discloses the backing endpoint (POST /cohorts/pnl-decomposition), that selection+drift sum exactly to the total, that weights are held constant and not normalized, that shorts are negative weights, that unmapped positions appear in coverage.dropped, that data is historical end-of-day, and that each call costs $0.25.

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: the usage condition and the primary exclusion come first, then the return/behavioral detail. Every clause carries information, though the mid-sentence semicolon chain is heavy; sizing is appropriate for a paid, non-trivial analytics call.

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?

There is no output schema, so the description must explain the return contract, and it does: selection, drift, their exact summation, and the coverage.dropped list. Together with the pricing and historical-data note, an agent has everything needed to call and interpret it.

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 the baseline is 3. The description reinforces weight-sign semantics ('a short is a negative weight') and adds the non-normalization/constant-weight constraint, but it repeats the schema's weight definition and adds little on level, end_date, min_names, or include_series.

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 states a specific verb+resource: attributing a book's realized residual return over a date window to stock selection versus drift. It clearly distinguishes itself from the general riskmodels_decompose and from riskmodels_portfolio_exposure by naming what it does not cover, so an agent can select it without opening schemas.

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?

It leads with explicit 'Use when...' guidance for the target scenario and provides an explicit exclusion plus alternative: 'Not for current risk or hedges (use riskmodels_portfolio_exposure)'. When-to-use and when-not-to-use are both spelled out.

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