Skip to main content
Glama
Quantified Self MCP Server

Quantified Self MCP Server

Log a raw measurement

log_measurement

Record a single timestamped observation—one metric, value, and source—when exact time or multiple same-day readings matter. Use it for point-in-time health data instead of end-of-day summaries.

Instructions

Record a single raw observation — one metric, one value, one point in time — rather than a whole day's summary. Use this instead of log_daily_metric when the source, exact time, or the fact that there were multiple readings that day matters (e.g. three separate workouts, or a wearable's periodic heart-rate samples).

Use this tool when:

  • recording one timestamped observation where the exact time, source, or possibility of multiple same-day readings matters (e.g. "record my blood pressure reading from my cuff at 7am").

Do not use this tool when:

  • it's just a single end-of-day value for a fixed metric -> use log_daily_metric instead.

  • it's a workout/exercise session -> use log_workout_session 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "timestamp": "<timestamp>",
      "metric": "<metric>",
      "value": "<value>"
    },
    "name": "log_measurement"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNoUnit the value is in, e.g. "bpm", "kg". Optional. If provided, must match the metric's canonical unit (case-insensitive); convert the reading to that canonical unit before logging.
valueYesThe numeric reading.
metricYesName of the metric, e.g. "resting_heart_rate", "steps". Not free-form: must already have an entry in the aggregation_rules table (steps, sleep_hours, resting_heart_rate, weight_kg, workout_minutes, mood, water_ml, heart_rate, hrv_ms, out of the box) — daily_metrics is a database-maintained projection over measurements (see db/schema.sql), so every metric written to it needs a known aggregation method (sum/mean/last) or there would be nothing telling the projection how to roll same-day readings up. metrics_schema lists the current set.
sourceNoWhere this came from, e.g. "Apple Watch", "manual". Optional.
timestampYesWhen the observation was taken, YYYY-MM-DD or a full ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS). Give local wall-clock time. A numeric UTC offset (e.g. -08:00) is dropped before storing, so the reading belongs to the day written in the timestamp; a trailing "Z" is kept and counts as UTC.
source_typeNoCategory of source, e.g. "wearable", "manual", "app". Optional.

Output Schema

NameRequiredDescriptionDefault
measurementYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / unit / description
      Previous value: -"Unit the value is in, e.g. \"bpm\", \"kg\". Optional."New value: +"Unit the value is in, e.g. \"bpm\", \"kg\". Optional. If provided,\nmust match the metric's canonical unit (case-insensitive);\nconvert the reading to that canonical unit before logging."
  2. Changed1 schema field changedv1.0.34
    • changedInput schema / properties / timestamp / description
      Previous value: -"When the observation was taken, YYYY-MM-DD or a full\nISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS)."New value: +"When the observation was taken, YYYY-MM-DD or a full\nISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS). Give local\nwall-clock time. A numeric UTC offset (e.g. -08:00) is dropped\nbefore storing, so the reading belongs to the day written in\nthe timestamp; a trailing \"Z\" is kept and counts as UTC."
  3. Changed2 schema fields changedv1.0.29
    • addedOutput schema / properties / measurement / properties / value / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / measurement / properties / value / type
      Removed value: -"number"
  4. Changed1 schema field changedv1.0.19
    • changedInput schema / properties / metric / description
      Previous value: -"Name of the metric, e.g. \"resting_heart_rate\", \"steps\".\nFree-form — not limited to daily_metrics' fixed columns."New value: +"Name of the metric, e.g. \"resting_heart_rate\", \"steps\".\nNot free-form: must already have an entry in the\naggregation_rules table (steps, sleep_hours,\nresting_heart_rate, weight_kg, workout_minutes, mood,\nwater_ml, heart_rate, hrv_ms, out of the box) — daily_metrics\nis a database-maintained projection over measurements (see\ndb/schema.sql), so every metric written to it needs a known\naggregation method (sum/mean/last) or there would be nothing\ntelling the projection how to roll same-day readings up.\nmetrics_schema lists the current set."
  5. Changed14 schema fields changedv1.0.16
    • removedInput schema / properties / date
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / metric
      Added value: +{
      +  "description": "Name of the metric, e.g. \"resting_heart_rate\", \"steps\".\nFree-form — not limited to daily_metrics' fixed columns.",
      +  "type": "string"
      +}
    • removedInput schema / properties / metric_name
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / notes
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null
      -}
    • addedInput schema / properties / source
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Where this came from, e.g. \"Apple Watch\", \"manual\". Optional."
      +}
    • addedInput schema / properties / source_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Category of source, e.g. \"wearable\", \"manual\", \"app\". Optional."
      +}
    • addedInput schema / properties / timestamp
      Added value: +{
      +  "description": "When the observation was taken, YYYY-MM-DD or a full\nISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS).",
      +  "type": "string"
      +}
    • addedInput schema / properties / unit / description
      Added value: +"Unit the value is in, e.g. \"bpm\", \"kg\". Optional."
    • addedInput schema / properties / value / description
      Added value: +"The numeric reading."
    • changedInput schema / required
      Previous value: -[
      -  "date",
      -  "metric_name",
      -  "value"
      -]New value: +[
      +  "timestamp",
      +  "metric",
      +  "value"
      +]
    • addedOutput schema / properties / measurement
      Added value: +{
      +  "properties": {
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "integer"
      +    },
      +    "metric": {
      +      "type": "string"
      +    },
      +    "source": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "source_type": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "timestamp": {
      +      "type": "string"
      +    },
      +    "unit": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "value": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "timestamp",
      +    "metric",
      +    "value",
      +    "created_at"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "measurement"
      +]
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  6. Changed14 schema fields changedv1.0.15
    • addedInput schema / properties / date
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / metric
      Removed value: -{
      -  "description": "Name of the metric, e.g. \"resting_heart_rate\", \"steps\".\nFree-form — not limited to daily_metrics' fixed columns.",
      -  "type": "string"
      -}
    • addedInput schema / properties / metric_name
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / notes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • removedInput schema / properties / source
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Where this came from, e.g. \"Apple Watch\", \"manual\". Optional."
      -}
    • removedInput schema / properties / source_type
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Category of source, e.g. \"wearable\", \"manual\", \"app\". Optional."
      -}
    • removedInput schema / properties / timestamp
      Removed value: -{
      -  "description": "When the observation was taken, YYYY-MM-DD or a full\nISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS).",
      -  "type": "string"
      -}
    • removedInput schema / properties / unit / description
      Removed value: -"Unit the value is in, e.g. \"bpm\", \"kg\". Optional."
    • removedInput schema / properties / value / description
      Removed value: -"The numeric reading."
    • changedInput schema / required
      Previous value: -[
      -  "timestamp",
      -  "metric",
      -  "value"
      -]New value: +[
      +  "date",
      +  "metric_name",
      +  "value"
      +]
    • removedOutput schema / properties / measurement
      Removed value: -{
      -  "properties": {
      -    "created_at": {
      -      "type": "string"
      -    },
      -    "id": {
      -      "type": "integer"
      -    },
      -    "metric": {
      -      "type": "string"
      -    },
      -    "source": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null
      -    },
      -    "source_type": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null
      -    },
      -    "timestamp": {
      -      "type": "string"
      -    },
      -    "unit": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null
      -    },
      -    "value": {
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "id",
      -    "timestamp",
      -    "metric",
      -    "value",
      -    "created_at"
      -  ],
      -  "type": "object"
      -}
    • addedOutput schema / properties / result
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "measurement"
      -]New value: +[
      +  "result"
      +]
    • addedOutput schema / x-fastmcp-wrap-result
      Added value: +true
  7. Addedv1.0.11

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare the write/safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the bar is lower, but the description adds real context beyond them: the privacy note about returned data entering the conversation, and the explanation that metrics must exist in aggregation_rules because daily_metrics is a projection. It does not warn that repeated calls create duplicate readings despite idempotentHint=false, which is the one notable gap.

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 core distinction is front-loaded in the first sentence, followed by well-structured when/when-not bullets. The privacy paragraph is long but earns its place by disclosing a non-obvious data-flow consequence; overall it is slightly verbose but not padded.

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?

With an output schema present, return values need no explanation, and the description covers the remaining decision-relevant concerns: when to pick this over siblings, the metric-registry constraint, timestamp semantics, and the privacy implication. Nothing an agent needs to call it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents timestamp format, unit canonicalization, and the metric constraint in detail. The description reinforces the 'one metric, one value' framing and the multiple-readings rationale but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 states a specific verb and resource ('Record a single raw observation — one metric, one value, one point in time') and explicitly contrasts it with the day-summary sibling log_daily_metric. An agent can distinguish it from log_daily_metric and log_workout_session without opening any schema.

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?

It provides explicit 'Use this tool when' and 'Do not use this tool when' sections, naming both alternatives (log_daily_metric for end-of-day values, log_workout_session for exercise sessions) and the condition that selects each. Nothing is left to inference.

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