log_touch_grass
Log an outdoor session to update your streak and total touches. Permanently records each entry in your local state.
Instructions
Writes to local state. Records that the user went outside, increments total touches, and either extends or resets the daily streak based on the gap since the last entry. Mutates ~/.touch-grass/state.json (streak, longestStreak, totalTouches, history). NOT idempotent — each call adds an entry. Errors (e.g., disk full, permission denied on ~/.touch-grass) surface as structured tool errors with isError=true; the streak is not partially updated on failure.
Side effects: append-only file write. No network calls. No auth required. The mutation is local-only and persists across sessions.
When to use: ONLY after the user explicitly confirms they went outside (e.g., 'I just got back from a walk', 'done — touched grass'). Never on speculation.
When NOT to use: never call to 'test' the tool — every invocation permanently inflates the user's streak/totals and there is no built-in undo. Don't call when the user is merely planning to go outside; wait for confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity | No | Free-form label describing what the user just did outside (e.g., 'walk', 'coffee on porch', 'stretched'). Stored verbatim as the `activity` field of this streak entry in ~/.touch-grass/state.json — it becomes the human-readable record of THIS recording action. Optional; defaults to 'outside time'. Has no effect on streak math; purely descriptive metadata for history readback. |