Skip to main content
Glama
Quantified Self MCP Server

Quantified Self MCP Server

Log a raw measurement

log_measurement

Record one raw metric value at a specific timestamp, including optional source and unit, to track multiple readings per day instead of a single daily summary.

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).

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?

The annotations only declare write/non-idempotent/non-destructive/non-open-world, so the description earns credit for disclosing that the server and SQLite file are local while returned data enters the conversation context and may leave the machine. It does not address what happens on a duplicate timestamp (relevant given idempotentHint=false) or any validation failure behavior beyond what the schema already says.

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-loaded with the core definition, then a bulleted exclusion list, then the privacy caveat in its own block — easy to scan and nothing is buried. The privacy paragraph is longer than strictly necessary for a tool definition, though it is substantive rather than filler.

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?

An output schema exists, so return values need no explanation, and annotations cover the safety profile. What remains — granularity, alternatives, and the data-flow caveat — is fully covered, leaving no decision an agent would need to make blind.

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 coverage is 100% and the schema descriptions are unusually detailed (timestamp offset handling, unit canonicalization, metric whitelist), so the description only needs to stay out of the way. It adds marginal meaning by pointing at source and exact time as the reasons to prefer this tool, but contributes no syntax or constraint detail beyond the schema.

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?

"Record a single raw observation — one metric, one value, one point in time" gives a specific verb plus the exact granularity of the resource, and explicitly contrasts it with a whole-day summary. The named siblings log_daily_metric and log_workout_session make the boundary unambiguous.

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 states positive selection criteria (source, exact time, or multiple readings per day matter, with concrete examples of three workouts or periodic HR samples) and then an explicit "Do not use this tool when" list routing each excluded case to a named alternative.

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