Skip to main content
Glama
PhilipAD

MetricBridge (formerly Health Export AI)

add_event

Idempotent

Log medication starts, habit changes, visits, or trips as context events so later analysis can segment around them; returns stored event with id and avoids duplicates.

Instructions

Log a context event the user tells you about (a medication start, a habit change, a visit, a trip) so later analysis can segment around it. Writes ONLY health-events-agent.json in the export folder, never Apple Health and never a file the iOS app writes; the app shows these events read-only. Returns the stored event with its id (starting "agent-"). Idempotent: repeating a call with the same clientEventId (or, without one, the same date, type, title and endDate) returns the event already logged instead of adding a duplicate. Ask the user before logging anything they did not state. Refused in demo mode, when the folder is not writable, and on an encrypted export without HEALTH_EXPORT_PASSPHRASE (the file is sealed like the rest of the export when the passphrase is set).

Input Schema

NameRequiredDescriptionDefault
dateYesLocal day the event happened or started, YYYY-MM-DD.
noteNoOptional longer note, at most 2000 characters.
tagsNoOptional tags for filtering, e.g. ["magnesium"]. At most 20.
typeYesEvent type: medication, habit, visit, life, shift, episode, travel or other. Range types (shift, travel, episode) usually carry an endDate.
titleYesShort description, e.g. "Started magnesium 300 mg". At most 200 characters.
endDateNoLast day of a range event (inclusive), YYYY-MM-DD, not before date. Omit for a point event.
clientEventIdNoOptional idempotency key: the same key never logs a second event.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.8.0

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantially beyond annotations: exact file written, explicit statement that Apple Health and app-owned files are untouched, read-only visibility in the app, the returned id prefix, idempotency fallback rules, and three distinct refusal conditions including passphrase sealing.

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 is front-loaded, then constraints, then return value, then failure modes — a sensible order. Dense but every clause carries information; the file-path clause is slightly verbose but justified by the safety point it makes.

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 still specifies the return shape (stored event with agent-prefixed id). Mutation side effects, idempotency, and failure modes are all covered, so an agent can call it safely without further context.

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 baseline is 3; the description earns extra by explaining the idempotency fallback (same date/type/title/endDate when no clientEventId is supplied), which the schema does not state. Range-vs-point event semantics are left to 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?

Specific verb+resource ("Log a context event") with concrete examples (medication start, habit change, visit, trip) that map onto the type enum. Clearly a write-side counterpart to list_events/remove_event in the sibling set.

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

Usage Guidelines4/5

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

Gives a clear trigger ("the user tells you about") and an explicit precondition ("Ask the user before logging anything they did not state"). Refusal conditions (demo mode, unwritable folder, encrypted export without passphrase) are enumerated, though no sibling tool is named as an alternative for reading these events back.

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