Skip to main content
Glama

query_body_measurements

Read-onlyIdempotent

Read timestamped body measurements from a local Mi Fitness cache over an inclusive date range, with optional metric filtering or latest-record selection.

Instructions

Read timestamped body measurements over an inclusive YYYY-MM-DD range. Returns data.measurements and data.count in timestamp order; latest_only=true returns only the last matching record, not the latest value of each field. Omitted/empty metrics returns all available fields; otherwise timestamp plus selected fields, with absent optional measurements omitted. Units are kg for mass, percent for body fat/water, dimensionless for BMI. Use query_metric_series(metric=weight_kg) for a daily or aggregated weight trend. latest_only selects before pagination. Read-only local SQLite query; no cloud request or automatic sync. Requires a configured local account/cache. Returns JSON text with status, source=cache, generated_at and data; empty lists mean no cached matches, not zero measurements. Use get_data_coverage to inspect availability or sync_data to refresh with user consent. Returns data.pagination {limit, offset, has_more, next_offset}; next_offset is null at the end. Keep filters unchanged and avoid syncing between pages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum records per page (1-5000); count describes this page only.
offsetNoZero-based position; pass pagination.next_offset unchanged with the same filters.
metricsNoOptional body-field projection; timestamp always remains. Omit or [] for all available fields. Missing optional fields are omitted, not zero.
end_dateYesInclusive last calendar date, YYYY-MM-DD; must be on or after start_date.
start_dateYesInclusive first calendar date, YYYY-MM-DD; must be on or before end_date. Uses stored calendar dates, not caller timezone conversion.
latest_onlyNoReturn only the last measurement in this range when true; false returns all matching records.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.4
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 5000,
      +  "description": "Maximum records per page (1-5000); count describes this page only.",
      +  "maximum": 5000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Zero-based position; pass pagination.next_offset unchanged with the same filters.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Changed12 schema fields changedv0.3.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / end_date / description
      Added value: +"Inclusive last calendar date, YYYY-MM-DD; must be on or after start_date."
    • addedInput schema / properties / end_date / examples
      Added value: +[
      +  "2026-01-15"
      +]
    • addedInput schema / properties / end_date / format
      Added value: +"date"
    • addedInput schema / properties / end_date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • addedInput schema / properties / latest_only / default
      Added value: +false
    • addedInput schema / properties / latest_only / description
      Added value: +"Return only the last measurement in this range when true; false returns all matching records."
    • addedInput schema / properties / metrics / description
      Added value: +"Optional body-field projection; timestamp always remains. Omit or [] for all available fields. Missing optional fields are omitted, not zero."
    • addedInput schema / properties / start_date / description
      Added value: +"Inclusive first calendar date, YYYY-MM-DD; must be on or before end_date. Uses stored calendar dates, not caller timezone conversion."
    • addedInput schema / properties / start_date / examples
      Added value: +[
      +  "2026-01-15"
      +]
    • addedInput schema / properties / start_date / format
      Added value: +"date"
    • addedInput schema / properties / start_date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
  3. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, but the description goes well beyond: local SQLite query with no cloud request or sync, requirement of a configured local account/cache, and the crucial semantic that empty lists mean no cached matches rather than zero measurements. It also discloses that latest_only selects before pagination and that next_offset is null at the end.

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 purpose is front-loaded in the first sentence, followed by return shape, semantics, sibling routing, and caching caveats. It is dense and slightly run-on, but nearly every clause carries distinct information and nothing is padding.

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 no output schema, the description carries the return-shape burden and does so thoroughly (data.measurements, data.count, status, source=cache, generated_at, pagination with next_offset). For a 6-param read tool with sibling alternatives, nothing an agent needs to invoke it correctly 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 real meaning beyond the schema: units (kg, percent, dimensionless), the clarification that latest_only returns the last record rather than the latest value per field, and metric-projection behavior with absent fields omitted rather than zeroed. These complement rather than merely restate 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?

States a specific verb ('Read') and resource ('timestamped body measurements') with scope ('inclusive YYYY-MM-DD range'). It explicitly distinguishes itself from the sibling query_metric_series, so an agent can route correctly without opening either 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?

Names the alternative ('Use query_metric_series(metric=weight_kg) for a daily or aggregated weight trend') and points to get_data_coverage and sync_data for availability and refresh. It also warns to keep filters unchanged and avoid syncing between pages, which is genuine when/when-not guidance.

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