Skip to main content
Glama

get_correlation_matrix

Calculate pairwise correlations between portfolio assets using daily returns to analyze diversification and risk relationships.

Instructions

Get the correlation matrix for portfolio assets.

Calculates pairwise correlations between all assets in the portfolio based on daily returns. Args: name: The portfolio name. Returns: Dictionary containing: - symbols: List of symbols - correlation_matrix: 2D correlation matrix - correlations: Readable format with symbol pairs Example: ``` result = get_correlation_matrix(name="tech_stocks") # Check correlation between GOOG and AMZN corr = result['correlations']['GOOG']['AMZN'] ```

Caching Behavior:

  • Any input parameter can accept a ref_id from a previous tool call

  • Large results return ref_id + preview; use get_cached_result to paginate

  • All responses include ref_id for future reference

Preview Size: server default. Override per-call with get_cached_result(ref_id, max_size=...).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

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/l4b4r4b4b4/portfolio-mcp'

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