Skip to main content
Glama
quanttrucker

portfolio-analytics-mcp

by quanttrucker

sector_correlation

Compute correlation matrix between sectors of your portfolio to assess diversification and concentration risk. Each sector becomes a weighted return series built from its members.

Instructions

Compute the correlation matrix between sectors of a portfolio you supply.

Use this to answer how diversified a book actually is — "are my sectors moving together", "where is the concentration risk". Each sector becomes a single weighted return series built from its members, and the tool correlates those series against each other.

Every holding needs a sector label; holdings without one are ignored. Weights are used to size members within their sector and default to equal weighting. As with every tool here, you supply the portfolio — nothing is looked up.

A correlation can legitimately come back null: if a sector's members offset each other exactly, its series has no variance and correlation against it is undefined rather than zero.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
holdingsYes
lookback_daysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
startYes
matrixYesCorrelation of each sector's weighted return series against every other.
sectorsYes
observationsYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently explains that holdings without a sector label are ignored, weights default to equal weighting and are normalized, and correlations can legitimately return null when a sector's series has zero variance. It also clarifies that the portfolio is user-supplied. This covers key behavioral edge cases, though it does not discuss error conditions or data requirements beyond this.

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?

The description is efficiently structured: a direct first sentence states the core action, followed by a use-case paragraph, then important caveats. Each sentence adds value, and the text is free of fluff. It front-loads the essential purpose while keeping technical details succinctly organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the main computation, user-supplied portfolio behavior, and a critical edge case (null correlations), and an output schema exists to specify return values. However, it omits the lookback_days parameter, which is essential for understanding the time horizon of the correlation. This omission makes the description incomplete for full autonomous invocation, despite the otherwise rich context.

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?

The description adds meaningful context for holdings and weights (e.g., 'holdings without one are ignored', 'default to equal weighting'), supplementing the schema's structure. However, the lookback_days parameter is never mentioned, leaving its role and impact undocumented. Given that schema descriptions are absent for lookback_days (only a default of 365), this is a notable gap, but the description does compensate somewhat for the other parameters.

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 opens with a specific verb+resource: 'Compute the correlation matrix between sectors of a portfolio you supply.' It clearly distinguishes itself from sibling tools (portfolio_beta, revalue_positions) by focusing on sector-level correlation and diversification analysis. The use cases ('are my sectors moving together', 'where is the concentration risk') reinforce its unique purpose.

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?

The description provides clear context for when to use the tool ('Use this to answer how diversified a book actually is') but does not explicitly mention when not to use it or name alternative sibling tools. It sets expectations that the user supplies the portfolio and that nothing is looked up, which helps avoid misuse. However, it lacks explicit exclusions or comparisons.

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

Install Server

Other Tools

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

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