> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fitsociety.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Client AI Habits

> Reference for a connected client tracking and checking in their own habits.

The `client_ai_habits` module lets a client's AI assistant list assigned
habits, review check-in history, and submit habit check-ins. Client AI tools
are subject-bound: every call resolves to the authenticated client
(`subjectClientId`) and can only touch habits assigned to that client. The
module is available only when the company MCP integration feature is enabled,
client AI access is enabled for the client-company relationship, the company's
client MCP policy allows the module (write tools additionally require the
company policy to allow them), and the client has granted health data consent.

| Key                  | Value               |
| :------------------- | :------------------ |
| **Module Key**       | `client_ai_habits`  |
| **Sensitivity**      | `health`            |
| **Consent Required** | `healthDataConsent` |

***

## Available Tools

### `client_ai_list_my_habits`

Retrieve all active habits assigned to your account, including their description, type, goal period, and log mode.

* **Type:** Read-only
* **Important Input Fields:** None.

### `client_ai_get_my_habit_entries`

Retrieve a history of habit checks/entries for yourself within a specific date range (maximum 31 days). Optionally filter by habitId.

* **Type:** Read-only
* **Important Input Fields:**
  * `dateFrom` (string, required): Start date filter in ISO 8601 format (`YYYY-MM-DD` or `YYYY-MM-DDTHH:mm:ssZ`).
  * `dateTo` (string, required): End date filter in ISO 8601 format. Max window is 31 days.
  * `habitId` (string, optional): Habit ID to filter entries.

### `client_ai_check_in_my_habit` **`Write`**

Submit a completion check-in value or entry for a habit already assigned to yourself. Cannot create or edit habits.

* **Type:** Write
* **Important Input Fields:**
  * `habitId` (string, required): The unique ID of the habit (obtained from `client_ai_list_my_habits`).
  * `occurredAt` (string, required): ISO 8601 UTC date-time string when the habit was completed/checked.
  * `value` (number, required): The check-in value (e.g. 1 for a completed binary habit, or a numeric value).
  * `note` (string, optional): Notes accompanying the check-in. Max 500 chars.

***

## Natural Language Examples

* *"Which habits do I need to complete today?"*
* *"Check off my hydration habit — I drank 2 liters."*
* *"How consistent was I with my sleep habit over the last two weeks?"*

***

## JSON-RPC Call Example (`client_ai_check_in_my_habit`)

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": "client-habits-1",
  "method": "tools/call",
  "params": {
    "name": "client_ai_check_in_my_habit",
    "arguments": {
      "habitId": "64b64c0f2f5f4c0012345678",
      "occurredAt": "2026-08-23T08:30:00Z",
      "value": 1,
      "note": "Morning walk done."
    }
  }
}
```
