Skip to main content
Glama
jasonwu001t

marketlens-mcp

by jasonwu001t

Correlation matrix

analytics_correlation
Read-onlyIdempotent

Compute pairwise Pearson correlations between series in a stored result, aligning timestamps, converting prices to returns, and flagging pairs with too few shared points.

Instructions

Pairwise Pearson correlation of the series in one stored result (e.g. bars of several tickers, or returns), computed locally in DuckDB, in long form: one row per pair (a, b), both orders and the diagonal included. Each pair uses the timestamps where both series have a value. value_column defaults to the model's first value column; a column in price units (close) is turned into simple returns per pair first. A pair with fewer than min_overlap (20) shared observations gets None (insufficient_data). At most 50 series. Large outputs are stored and you get a result_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoPearson correlation.pearson
result_idYesA stored result holding several series (e.g. bars of several tickers, or returns).
min_overlapNoFewest shared observations for a value; below it the cell is None.
value_columnNoNumeric column to correlate. Default: the model's first value column (ret for returns, close for bars; ret for a query result that has one). A column in price units is turned into simple returns first.
series_columnNoColumn naming each series. Default: the result's group column.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already cover read-only and idempotent behavior, but the description adds substantial operational context: DuckDB-local computation, long-form output with both pair orders and diagonal, pairwise-complete timestamps, insufficient_data threshold behavior, a 50-series cap, and large-output result_id storage. No annotation contradiction.

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?

The description is front-loaded and dense, with nearly every sentence carrying behavioral detail. It is longer than strictly minimal but remains focused, with only slight implementation-density that keeps it from being perfectly concise.

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 no-output-schema analytics tool, the description explains output shape, edge-case behavior, scale limits, and result-storage behavior. Combined with full schema coverage and safety annotations, it is complete enough for correct invocation.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining value_column default logic, price-to-returns transformation, and min_overlap producing None below the threshold, though it does not cover every parameter in depth.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a precise operation, resource, and output shape: pairwise Pearson correlation of series in one stored result, returned in long form. It does not explicitly name or distinguish sibling analytics tools, but the verb+resource is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Implies usage when pairwise correlations across series in a stored result are needed, with examples such as bars of several tickers or returns. It gives no explicit when-to-use, when-not-to-use, or alternative-tool guidance (e.g. analytics_returns, analytics_beta).

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