Skip to main content
Glama
Thecimal

Quantified Self MCP Server

Explain a metric change

explain_metric_change
Read-onlyIdempotent

Build an evidence bundle for a chosen metric and date: compare against a 90-day baseline, detect anomalies, show the trend, and surface correlated metrics.

Instructions

Build an evidence bundle for "why did my look like that on ?": that day's value against a 90-day baseline, whether it qualifies as an anomaly, the trend leading into it, and any other metric that correlates with it strongly enough to be worth mentioning. Returns facts, not an explanation — turning "sleep was 2.6 stdev below baseline and resting heart rate correlates at r=0.71" into an actual answer for the person is what the calling model should do with these facts, not something this tool guesses at itself.

Do not use this tool when:

  • scanning across many metrics for what changed lately, without a specific metric/date in mind -> use get_recent_changes instead.

  • you only need one piece of this bundle (just the baseline, just the trend, just anomalies, or just a correlation) rather than the full why-explanation -> use get_baseline, calculate_metric_trend, detect_metric_anomalies, or find_metric_correlation directly instead.

Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesThe day to explain, formatted YYYY-MM-DD.
metricYesOne of steps, sleep_hours, resting_heart_rate, weight_kg, workout_minutes, mood, water_ml, heart_rate, hrv_ms.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
trendYes
valueNo
metricYes
baselineYes
sessionsNo
is_anomalyYes
baseline_rangeYes
trend_evidenceYesCoverage/quality of the data a single-metric analytical result is based on. See evidence.build_evidence for how each field is computed.
narrative_factsYes
modified_z_scoreNo
baseline_evidenceYesCoverage/quality of the data a single-metric analytical result is based on. See evidence.build_evidence for how each field is computed.
correlated_metricsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedOutput schema / properties / baseline_evidence
      Added value: +{
      +  "description": "Coverage/quality of the data a single-metric analytical result is\nbased on. See evidence.build_evidence for how each field is computed.",
      +  "properties": {
      +    "confidence": {
      +      "type": "string"
      +    },
      +    "coverage_ratio": {
      +      "type": "number"
      +    },
      +    "expected_days": {
      +      "type": "integer"
      +    },
      +    "freshness_days": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "gaps": {
      +      "items": {
      +        "properties": {
      +          "days": {
      +            "type": "integer"
      +          },
      +          "end": {
      +            "type": "string"
      +          },
      +          "start": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "start",
      +          "end",
      +          "days"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "measurement_count": {
      +      "type": "integer"
      +    },
      +    "missing_days": {
      +      "type": "integer"
      +    },
      +    "observed_days": {
      +      "type": "integer"
      +    },
      +    "observed_end": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "observed_start": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "recent_gap_days": {
      +      "type": "integer"
      +    },
      +    "requested_end": {
      +      "type": "string"
      +    },
      +    "requested_start": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "requested_start",
      +    "requested_end",
      +    "expected_days",
      +    "observed_days",
      +    "coverage_ratio",
      +    "missing_days",
      +    "measurement_count",
      +    "gaps",
      +    "recent_gap_days",
      +    "confidence"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / correlated_metrics / items / properties / evidence_a
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Coverage/quality of the data a single-metric analytical result is\nbased on. See evidence.build_evidence for how each field is computed.",
      +      "properties": {
      +        "confidence": {
      +          "type": "string"
      +        },
      +        "coverage_ratio": {
      +          "type": "number"
      +        },
      +        "expected_days": {
      +          "type": "integer"
      +        },
      +        "freshness_days": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "gaps": {
      +          "items": {
      +            "properties": {
      +              "days": {
      +                "type": "integer"
      +              },
      +              "end": {
      +                "type": "string"
      +              },
      +              "start": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "start",
      +              "end",
      +              "days"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "measurement_count": {
      +          "type": "integer"
      +        },
      +        "missing_days": {
      +          "type": "integer"
      +        },
      +        "observed_days": {
      +          "type": "integer"
      +        },
      +        "observed_end": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "observed_start": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "recent_gap_days": {
      +          "type": "integer"
      +        },
      +        "requested_end": {
      +          "type": "string"
      +        },
      +        "requested_start": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "requested_start",
      +        "requested_end",
      +        "expected_days",
      +        "observed_days",
      +        "coverage_ratio",
      +        "missing_days",
      +        "measurement_count",
      +        "gaps",
      +        "recent_gap_days",
      +        "confidence"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedOutput schema / properties / correlated_metrics / items / properties / evidence_b
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Coverage/quality of the data a single-metric analytical result is\nbased on. See evidence.build_evidence for how each field is computed.",
      +      "properties": {
      +        "confidence": {
      +          "type": "string"
      +        },
      +        "coverage_ratio": {
      +          "type": "number"
      +        },
      +        "expected_days": {
      +          "type": "integer"
      +        },
      +        "freshness_days": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "gaps": {
      +          "items": {
      +            "properties": {
      +              "days": {
      +                "type": "integer"
      +              },
      +              "end": {
      +                "type": "string"
      +              },
      +              "start": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "start",
      +              "end",
      +              "days"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "measurement_count": {
      +          "type": "integer"
      +        },
      +        "missing_days": {
      +          "type": "integer"
      +        },
      +        "observed_days": {
      +          "type": "integer"
      +        },
      +        "observed_end": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "observed_start": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "recent_gap_days": {
      +          "type": "integer"
      +        },
      +        "requested_end": {
      +          "type": "string"
      +        },
      +        "requested_start": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "requested_start",
      +        "requested_end",
      +        "expected_days",
      +        "observed_days",
      +        "coverage_ratio",
      +        "missing_days",
      +        "measurement_count",
      +        "gaps",
      +        "recent_gap_days",
      +        "confidence"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedOutput schema / properties / trend_evidence
      Added value: +{
      +  "description": "Coverage/quality of the data a single-metric analytical result is\nbased on. See evidence.build_evidence for how each field is computed.",
      +  "properties": {
      +    "confidence": {
      +      "type": "string"
      +    },
      +    "coverage_ratio": {
      +      "type": "number"
      +    },
      +    "expected_days": {
      +      "type": "integer"
      +    },
      +    "freshness_days": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "gaps": {
      +      "items": {
      +        "properties": {
      +          "days": {
      +            "type": "integer"
      +          },
      +          "end": {
      +            "type": "string"
      +          },
      +          "start": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "start",
      +          "end",
      +          "days"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "measurement_count": {
      +      "type": "integer"
      +    },
      +    "missing_days": {
      +      "type": "integer"
      +    },
      +    "observed_days": {
      +      "type": "integer"
      +    },
      +    "observed_end": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "observed_start": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "recent_gap_days": {
      +      "type": "integer"
      +    },
      +    "requested_end": {
      +      "type": "string"
      +    },
      +    "requested_start": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "requested_start",
      +    "requested_end",
      +    "expected_days",
      +    "observed_days",
      +    "coverage_ratio",
      +    "missing_days",
      +    "measurement_count",
      +    "gaps",
      +    "recent_gap_days",
      +    "confidence"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "metric",
      -  "date",
      -  "baseline_range",
      -  "baseline",
      -  "is_anomaly",
      -  "trend",
      -  "correlated_metrics",
      -  "narrative_facts"
      -]New value: +[
      +  "metric",
      +  "date",
      +  "baseline_range",
      +  "baseline",
      +  "is_anomaly",
      +  "trend",
      +  "correlated_metrics",
      +  "narrative_facts",
      +  "baseline_evidence",
      +  "trend_evidence"
      +]
  2. Addedv1.0.16
  3. Removedv1.0.15
  4. Changed1 schema field changedv0.3.0
    • addedOutput schema / properties / sessions
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "properties": {
      +      "activity_type": {
      +        "type": "string"
      +      },
      +      "avg_heart_rate": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "created_at": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "type": "string"
      +      },
      +      "duration_minutes": {
      +        "type": "integer"
      +      },
      +      "id": {
      +        "type": "integer"
      +      },
      +      "intensity": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "max_heart_rate": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "notes": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "source": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "start_time": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "date",
      +      "activity_type",
      +      "duration_minutes",
      +      "created_at"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  5. Addedv1.0.11

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, and the description does not contradict them. It adds valuable behavioral context: the tool intentionally returns facts and not explanations, delegates the interpretive step to the calling model, and includes a privacy note that returned data becomes part of the conversation sent to the configured model.

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 longer than average, but every sentence earns its place: the core purpose is front-loaded, the returns-facts-not-explanation distinction is critical, the usage exclusions are concrete, and the privacy note is operationally relevant. There is no filler or repetition of schema fields.

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 rich output schema, the two parameters with full schema coverage, and annotations that already convey safety/idempotency, the description covers all remaining context an agent needs: when to use the tool, what it will and won't do, what data feeds into it, and privacy implications. Nothing important is missing.

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 100%, so the baseline is 3, but the description adds semantic meaning beyond the schema: it clarifies that 'date' anchors the 90-day baseline comparison and 'metric' is the subject of anomaly, trend, and correlation analysis. The example ('sleep was 2.6 stdev below baseline...') further illustrates how the two parameters are interpreted.

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 names a specific verb and resource ('Build an evidence bundle' for a metric/date), then enumerates exactly what the bundle contains: value vs 90-day baseline, anomaly status, trend, and correlated metrics. It also distinguishes itself from sibling tools by stating it returns facts rather than a synthesized explanation, so an agent can tell it apart from get_recent_changes and the individual metric tools.

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

Usage Guidelines5/5

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

The description gives explicit 'Do not use this tool when' conditions and names the correct alternatives for each case (get_recent_changes for scanning, and get_baseline/calculate_metric_trend/detect_metric_anomalies/find_metric_correlation for single-piece needs). This leaves no ambiguity about when to invoke this tool versus its siblings.

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