> ## 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 Nutrition

> Reference for a connected client reviewing nutrition logs and logging food.

The `client_ai_nutrition` module lets a client's AI assistant review the
client's own daily nutrition logs, search the nutrition catalog for food
products and recipes, and log consumed food. Client AI tools are
subject-bound: every call resolves to the authenticated client
(`subjectClientId`) and can never touch another client's nutrition data. 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_nutrition` |
| **Sensitivity**      | `health`              |
| **Consent Required** | `healthDataConsent`   |

***

## Available Tools

### `client_ai_get_my_nutrition_day`

Retrieve full slot and meal-item details for one of my calendar days.

* **Type:** Read-only
* **Important Input Fields:**
  * `dayId` (string, required): The unique day ID.

### `client_ai_list_my_nutrition_days`

Retrieve a list of my daily logged nutrition details (intake totals and adherence).

* **Type:** Read-only
* **Important Input Fields:**
  * `startDate` (string, optional): `YYYY-MM-DD` inclusive lower bound.
  * `endDate` (string, optional): `YYYY-MM-DD` inclusive upper bound.
  * `page` (integer, optional): Page number for pagination.
  * `limit` (integer, optional): Maximum number of items per page, max 50.

### `client_ai_search_food_products`

Search the nutrition catalog for food products across databases.

* **Type:** Read-only
* **Important Input Fields:**
  * `query` (string, optional): Search query string matched against name or barcode. Max 200 chars.
  * `excludedAllergenKeys` (array of strings, optional): Allergen keys to exclude (e.g. gluten, peanuts). Max 20 items.
  * `page` (integer, optional): Page number for pagination, starting at 1.
  * `limit` (integer, optional): Number of food products per page, max 50.

### `client_ai_search_recipes`

Search recipes across modern and legacy catalogs. Returns a paginated list.

* **Type:** Read-only
* **Important Input Fields:**
  * `query` (string, optional): Search query string matched against name/title. Max 200 chars.
  * `page` (integer, optional): Page number for pagination, starting at 1.
  * `limit` (integer, optional): Number of recipes per page, max 50.

### `client_ai_log_my_food` **`Write`**

Logs a consumed food item or recipe for myself. Resolves catalog items by name or uses exact ID, normalizing eatenAt date-times and checking consents. If multiple catalog items or portions match, the tool returns an `ambiguous` response with candidates instead of logging.

* **Type:** Write
* **Important Input Fields:**
  * `foodName` (string, optional): Plain-language food or recipe name (e.g. `banana`). Required if `itemId` is not specified. Max 128 chars.
  * `itemId` (string, optional): Exact catalog item ID. If provided, `itemType` must also be specified.
  * `itemType` (string, optional): Exact item type, one of `FoodProduct` or `Recipe`. Required if `itemId` is specified.
  * `amount` (number, optional): The quantity consumed (e.g. 1.5, 100). Defaults to 1.
  * `unit` (string, optional): The unit of measurement, one of `g`, `ml`, `serving`, `portion`. Defaults to `serving`.
  * `portionName` (string, optional): Name of the portion size used (e.g. `piece`, `bowl`, `slice`) when unit is `portion` or `serving`. Max 64 chars.
  * `eatenAt` (string, optional): ISO 8601 UTC date-time string when consumed. Defaults to now.
  * `slotKey` (string, optional): Target slot key for V2 (e.g. `breakfast`, `lunch`, `dinner`, `snack`). Defaults to `manual_log`.
  * `momentName` (string, optional): Legacy V1 moment name, one of `breakfast`, `snackAfterBreakfast`, `lunch`, `snackAfterLunch`, `dinner`, `snackAfterDinner`.

***

## Natural Language Examples

* *"Log a banana for breakfast."*
* *"How many calories have I eaten today?"*
* *"Find me a high-protein recipe without peanuts."*
* *"I just had 150 g of Greek yogurt as a snack."*

***

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

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": "client-nutrition-1",
  "method": "tools/call",
  "params": {
    "name": "client_ai_log_my_food",
    "arguments": {
      "foodName": "banana",
      "amount": 1,
      "unit": "serving",
      "slotKey": "breakfast",
      "eatenAt": "2026-08-23T07:45:00Z"
    }
  }
}
```
