Skip to main content
Glama

query_abnormal_heart_beat

Read-onlyIdempotent

Retrieve device-reported abnormal-heartbeat events from a local Mi Fitness cache within an inclusive date range, returning timestamps, durations, and count for review.

Instructions

Read device-reported abnormal-heartbeat events starting within an inclusive YYYY-MM-DD range. Returns data.events [{event_id, start_at, end_at, duration_seconds}] and data.count, earliest first. limit defaults to 5000; use offset for subsequent pages. Events are upstream flags, not a diagnosis; an empty list is not evidence of a healthy heart. Use query_heart_rate for ordinary bpm samples, not this event list. 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.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.4
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum earliest matching records to return (default 5000); use a small positive value to limit context. No offset/cursor is available."New value: +"Maximum records per page (1-5000); count describes this page only."
    • addedInput schema / properties / limit / maximum
      Added value: +5000
    • 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 / limit / default
      Added value: +5000
    • addedInput schema / properties / limit / description
      Added value: +"Maximum earliest matching records to return (default 5000); use a small positive value to limit context. No offset/cursor is available."
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • 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.6/5.0
Behavior5/5

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

Annotations already declare the safe read-only profile, but the description adds substantial context beyond them: no cloud request or automatic sync, cache-only results, empty list means no cached matches rather than no measurements, events are upstream flags not a diagnosis, and 'keep filters unchanged and avoid syncing between pages' for stable pagination. That is exactly the kind of behavioral nuance annotations cannot carry.

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?

Purpose and range semantics are front-loaded before the caveats, and almost every sentence carries operational value. It is slightly dense and mildly redundant in flagging empty-list interpretation twice, which keeps it from a 5.

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 supplies the return shapes (data.events fields, data.count, data.pagination with next_offset), pagination termination behavior, precondition (configured local account/cache), and error-surrogate semantics. Nothing an agent needs to call this 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 start_date, end_date, limit and offset are already fully documented with patterns, defaults and bounds. The description reinforces the default of 5000 and the offset-for-paging workflow but adds no format or constraint detail the schema lacks, 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?

States a specific verb (Read) and resource (device-reported abnormal-heartbeat events) plus the scoping dimension (inclusive YYYY-MM-DD range). It explicitly distinguishes itself from the sibling query_heart_rate, so an agent can route 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 (query_heart_rate for ordinary bpm samples) and the condition for choosing it, and routes to get_data_coverage for availability checks and sync_data for refreshes. It also warns that this is a local cache query requiring a configured account, which is genuine when-to-use guidance.

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