Skip to main content
Glama

compute_correlation_matrix

Compute the pairwise return-correlation matrix for a list of tickers. Fetches each ticker's daily history over range, converts it to daily returns, and computes the pairwise Pearson correlation (aligned on shared dates). Requires at least two tickers; tickers that cannot be fetched are dropped and noted in warnings (at least two must survive). Returns the standard envelope; values holds range, the tickers used, and matrix — a nested dict {rowTicker: {colTicker: correlation}} with a 1.0 diagonal. (paid: $0.0100/call)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeNo
tickersYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully discloses the process (fetching, return conversion, Pearson correlation, date alignment), failure handling (dropping fetch-failed tickers, requiring at least two survivors), output structure, and even cost. This exceeds typical transparency expectations.

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?

Every sentence earns its place: the purpose, the process, the constraints, the output format, and the cost are all compactly stated in three sentences. The most critical information is front-loaded, and no waste is present.

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?

Given the lack of output schema and annotations, the description thoroughly covers the return envelope, matrix structure, diagonal, range, tickers used, and edge-case behavior. It is self-contained for safe invocation and result interpretation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides no descriptions (0% coverage), so the description must add meaning. It explains that 'tickers' requires at least two and clarifies that some may be dropped, and 'range' is used for the daily history window. However, it does not specify the default behavior when 'range' is omitted or detail each enum value's implications, leaving some gaps.

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 begins with a specific, action-oriented verb ('Compute') and names the exact resource ('pairwise return-correlation matrix') and input ('list of tickers'), clearly distinguishing it from sibling tools like single-ticker stats calculators or portfolio metrics.

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 purpose sentence establishes a clear context for use (computing correlations between tickers), but it does not explicitly mention when to avoid this tool or name alternatives. The guidance is implied, not explicit, 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources