Skip to main content
Glama

Log a prediction before the fact (local ledger, immutable)

log_prediction

Records a dated prediction with a stated probability in a local ledger so future Suunto session, HRV and recovery outcomes can be scored and your forecasts evaluated later.

Instructions

Writes down a prediction BEFORE the fact, with a probability, in the local ledger ~/.suunto-mcp/predictions.json (SUUNTO_PREDICTIONS_PATH overrides it). Writes only that file, never contacts Suunto, needs no Suunto credentials. A prediction is immutable once logged: it cannot be edited or deleted, only voided (void_prediction, with a reason, on a day before its date). The server scores it itself later (score_predictions) from Suunto's data and the journal, and get_prediction_stats says whether the stated probabilities were any good. date is the local day the prediction is about: strictly AFTER today (the server's local date: a prediction is about the future, so today is refused too) and at most 60 days ahead. kind is one of: 'session_done' (a workout exists on date), 'hrv_in_band' (the night AFTER date, the one leading into the next morning, has an HRV within the user's own p25..p75 band as get_baselines shows it, edges included), 'recovery_morning_at_least' (plus threshold, a Balance from 0 to 1 where x100 is the watch's Resources %: the morning recovery after the night after date is at least that), 'reps_hit' (plus exercise, sets, reps and optionally kg: on date, at least that many sets reached that many reps at that weight or more; the watch records only the guide's text, so this is scored from log_session entries and can be 'unresolvable' until the sets are logged). probability 0 to 1 is how likely the prediction is to come true in the caller's honest judgement; rule optionally names the rule or skill that made it, for the per-rule statistics; note is free text. A prediction identical to one still open (same kind, date and kind-specific fields; probability, note and rule do not count) is refused with the id of the open one, because it would count twice in the statistics. A prediction is due, and scored, from the second day after date (a day's data may sync late). Unknown fields and fields that do not belong to the kind are refused. At most 2000 predictions. Output: { saved: { id, madeAt, date, kind, probability, ..., due }, predictions (the count), note }. Not read-only (writes the ledger), not destructive (adds an entry), not idempotent (the same call again adds another prediction, or is refused as a duplicate). In demo mode the ledger is kept in memory.

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": {
      "date": "<date>",
      "kind": "<kind>",
      "probability": "<probability>"
    },
    "name": "log_prediction"
  }
}

Input Schema

NameRequiredDescriptionDefault
kgNoreps_hit: the weight, in kg, at which each set is predicted to reach the reps (that or more). Leave out for any weight.
dateYesThe local day the prediction is about, YYYY-MM-DD: after today, at most 60 days ahead.
kindYesWhat is predicted: session_done, hrv_in_band, recovery_morning_at_least or reps_hit.
noteNoFree text, e.g. why.
repsNoreps_hit: reps per set.
ruleNoThe rule or skill that made the prediction, e.g. 'weekly-plan'.
setsNoreps_hit: how many sets are predicted to reach the reps.
exerciseNoreps_hit: the exercise name as in get_exercise_history.
thresholdNorecovery_morning_at_least: the Balance on waking, 0 to 1 (0.6 = 60% Resources).
probabilityYesHow likely it is to come true, 0 to 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly=false, destructive=false, idempotent=false, openWorld=false, and the description is consistent with all of them while adding real context: it writes only one file, never contacts Suunto, needs no credentials, entries are immutable and unscorable until voided, duplicates would double-count in statistics, and demo mode keeps the ledger in memory. It also explains the asynchronous scoring lifecycle (due from the second day after `date` because data may sync late), which no annotation conveys.

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?

Core purpose and the ledger path are front-loaded, and every clause carries information — nothing is filler. The cost is that it reads as one dense block, with kind semantics, constraint rules, duplicate logic and output shape interleaved, which makes it harder to scan than a short bulleted layout would be.

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?

For a 10-parameter mutation tool with notable hidden constraints, the description covers everything an agent needs: storage location, credential and network behavior, date window, per-kind required fields, duplicate refusal, capacity limit, void path, scoring timing, and even the returned shape { saved{id, madeAt, date, kind, probability, ..., due}, predictions, note } despite no output schema existing.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds meaning the schema cannot: it defines each `kind` precisely (hrv_in_band targets the night AFTER `date` against the p25..p75 band from get_baselines, edges included; threshold is a Balance where x100 equals the watch's Resources %; reps_hit is scored from log_session entries and may be 'unresolvable'), clarifies `date` is the local day and strictly future, and notes that probability/note/rule are excluded from duplicate detection.

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 first sentence states a specific verb and resource: writes a prediction with a probability into a named local ledger file, and names the override env var. It also draws the boundary against siblings in the same paragraph — void_prediction for corrections, score_predictions for scoring, get_prediction_stats for calibration — so an agent can distinguish it without opening another 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 gives explicit when-to-use framing ('BEFORE the fact'), states the refusal conditions (date not strictly after today or beyond 60 days, duplicate of an open prediction, unknown or kind-mismatched fields, 2000-entry cap), and routes corrections to void_prediction with the reason-and-timing requirement. When-not-to-use and the alternative are both spelled out rather than inferred.

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