Skip to main content
Glama
Portfolio Analytics MCP

Portfolio Analytics MCP

by RugSec

get_correlation

Read-only

Computes correlation matrices of returns for 2+ tickers, using a common window and optional base-currency conversion to compare cross-market co-movement.

Instructions

Correlation matrix of returns between 2+ tickers (default weekly).

Exchange holidays are forward-filled and only the common window is used.
Without `base_currency`, each series is in its own currency, so FX moves
affect the result; set e.g. base_currency="EUR" to measure as a euro
investor experiences it.

Args:
    tickers: 2 or more Yahoo symbols.
    start_date: YYYY-MM-DD. Defaults to 2020-01-01.
    end_date: YYYY-MM-DD (exclusive).
    interval: "1d", "1wk" or "1mo".
    base_currency: Optional ISO code to convert all prices into first.

Returns:
    The `correlation` matrix with its window and observations, plus
    `missing` tickers and `warnings`; or an error dict.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tickers": "<tickers>"
    },
    "name": "get_correlation"
  }
}

Input Schema

NameRequiredDescriptionDefault
tickersYes
end_dateNo
intervalNo1wk
start_dateNo2020-01-01
base_currencyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint; the description adds real behavioral context beyond them — exchange holidays are forward-filled, series are intersected to a common window, and FX moves silently affect results unless base_currency is set. It also enumerates the returned fields (correlation matrix, window, observations, missing, warnings) despite no output schema.

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?

Front-loaded purpose sentence, then caveats, then Args/Returns blocks — well organized and every sentence adds information. The Args list partly restates parameter names from the schema, though each line adds format or semantics not present there.

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?

For a 5-parameter analytical tool with no output schema and only minimal annotations, the description covers inputs, currency pitfalls, windowing behavior, and the return payload including error and missing-ticker cases. An agent has everything needed to call it correctly and interpret the result.

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 description coverage is 0%, so the description must carry all parameter meaning — and it does: tickers as Yahoo symbols with a 2+ minimum (not enforced by the schema), start_date/end_date as YYYY-MM-DD with end exclusive, interval enumerations, and base_currency as an ISO code. This directly fills a documented gap in the structured fields.

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?

Opens with a precise verb+resource: "Correlation matrix of returns between 2+ tickers (default weekly)". No sibling tool produces a correlation matrix, and the stated scope (2+ tickers, returns, weekly default) lets an agent distinguish it from get_performance_stats or analyze_portfolio_risk 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 Guidelines4/5

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

Gives clear conditional guidance: omit base_currency for local-currency series, set e.g. base_currency="EUR" to measure from a euro investor's perspective, and notes that only the common window is used. Missing an explicit when-not-to-use or a named alternative, so it falls short of a 5.

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