Skip to main content
Glama

correlate

Measure how two health or context fields move together over a date range, such as stress and pollen or resting heart rate and sleep, with optional lag days.

Instructions

Measure how closely two fields (health or context, any combination) move together over a date range -- e.g. does stress correlate with pollen count, or resting heart rate with sleep duration. lag_days (-7 to +7) shifts field_b relative to field_a: a positive lag compares field_a on a given day against field_b lag_days days LATER (useful for "does X today predict Y a few days from now" questions); 0 (the default) compares same-day values. Returns both Pearson (linear relationship) and Spearman (monotonic relationship, more robust to outliers) correlation coefficients, each in [-1, 1], plus how many overlapping data points they were computed from.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_toYes
field_aYes
field_bYes
lag_daysNo
date_fromYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.7.5

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations and no output schema, the description carries the full behavioral burden and does so well: it discloses the two returned coefficients, their [-1, 1] range, the meaning of Pearson vs Spearman (linear vs monotonic, outlier robustness), and that an overlap count is returned. It omits any note on permissions, rate limits, or behavior when sample sizes are too small.

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-loads the core operation, then the lag semantics, then the return values. Every clause adds information, though the parenthetical explanations in the lag sentence are slightly dense. No filler or restatement of the name.

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

Completeness4/5

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

For a 5-parameter, no-output-schema statistical tool, the description covers operation, parameter semantics, and return values adequately. The remaining gap is field-name/date-format discovery and minimum-sample behavior, which an agent may need before invoking successfully.

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 coverage is 0%, so the description must carry parameter meaning. It fully specifies lag_days (bound -7 to +7, default 0, direction of shift), and covers field_a/field_b ('two fields, health or context, any combination') and the date range implicitly. It does not state the accepted field-name or date-string formats.

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?

States a specific statistical verb+resource ('Measure how closely two fields move together over a date range') and gives concrete examples (stress vs pollen, resting HR vs sleep duration). This is clearly distinguishable from siblings like baselines, anomalies, and query_health, which return values rather than relationships.

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?

Usage context is clear via worked examples and the lag_days use case ('does X today predict Y a few days from now'), giving the agent a good sense of when this tool applies. It does not, however, name which sibling to use instead when the agent merely wants raw values (query_health/query_context) or how to discover valid field names (list_available_fields).

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