Skip to main content
Glama

Correlate two signals

correlate_metrics
Read-onlyIdempotent

Resamples two health signals onto a common time grid and calculates their Pearson or Spearman correlation with p-value and sample size.

Instructions

Correlate two health signals aligned onto a common time grid.

Resamples each signal to one value per resample bucket (day/week/month) with agg, inner-joins the buckets they share, then computes Pearson and/or Spearman correlation with a two-sided p-value and the paired sample size. Either signal may come from any source: metric, wearable, lab, biomarker, substance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aggNohow to collapse multiple readings in a bucket ('mean','median','sum','min','max','first','last','count').mean
userNowhich person; defaults to the primary user.
sinceNo
untilNo
methodNo'pearson' | 'spearman' | 'both'.both
name_aYes
name_bYes
lag_daysNoonly with resample='day'. Positive values pair each A bucket with the B bucket `lag_days` days earlier (tests whether B leads A).
resampleNo'day' | 'week' | 'month' bucket granularity.day
source_aYes
source_bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond annotations (readOnlyHint, idempotentHint), the description discloses resampling to a common grid, inner join, computation of Pearson/Spearman correlation with p-value and sample size, and that signals can come from any source. No contradictions.

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 four sentences, front-loaded with the main purpose, and every sentence adds value. No redundant or overly technical jargon.

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?

Given the complexity (11 params, output schema exists), the description explains the correlation process and key parameters. It could mention the output format, but that is already covered by the output schema. Overall adequate.

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?

With 45% schema coverage, the description adds meaning by explaining resample, agg, method, lag_days in the context of aligning signals and computing correlation. It does not detail every parameter but covers core ones adequately.

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 clearly states the tool correlates two health signals onto a common time grid, using resampling, aggregation, and Pearson/Spearman correlation. It is specific with verb and resource, and distinguishes from siblings like align_series by focusing on correlation computation.

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?

The description implies usage for correlating signals but does not explicitly state when to use this tool versus alternatives like align_series or analyze_trend tools. No when-not-to-use guidance is provided.

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/Cole-Will-I-Am/HealthLedger-MCP'

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