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

> Reference for a connected client reading their chats and messaging their coach.

The `client_ai_messages` module lets a client's AI assistant list the client's
chats, read message history, and send text messages to coaches within the
company. Client AI tools are subject-bound: every call resolves to the
authenticated client (`subjectClientId`); only chats the client participates
in are readable, and messages can be sent exclusively to coaches within the
client's company. 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 private communication consent.

| Key                  | Value                         |
| :------------------- | :---------------------------- |
| **Module Key**       | `client_ai_messages`          |
| **Sensitivity**      | `private_communication`       |
| **Consent Required** | `privateCommunicationConsent` |

***

## Available Tools

### `client_ai_list_my_chats`

Retrieve all chats where you are a participant. Chats are sorted by most recent activity.

* **Type:** Read-only
* **Important Input Fields:**
  * `page` (integer, optional): Page number for pagination.
  * `limit` (integer, optional): Number of chats per page, max 50.

### `client_ai_get_my_messages`

Retrieve the message history of a chat that you belong to, sorted by most recent message first.

* **Type:** Read-only
* **Important Input Fields:**
  * `chatId` (string, required): The unique ID of the chat.
  * `page` (integer, optional): Page number for pagination.
  * `limit` (integer, optional): Number of messages to load, max 100.

### `client_ai_send_message_to_my_coach` **`Write`**

Send a text message to your coach in this company. Restricts communication exclusively to coaches within your company.

* **Type:** Write
* **Important Input Fields:**
  * `coachId` (string, required): The unique ID of the coach.
  * `message` (string, required): The text message content to send. Max 2000 chars.

***

## Natural Language Examples

* *"Did my coach reply to my question about deload week?"*
* *"Message my coach that I'll be 10 minutes late tomorrow."*
* *"Summarize my chat with my coach from this week."*

***

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

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": "client-messages-1",
  "method": "tools/call",
  "params": {
    "name": "client_ai_send_message_to_my_coach",
    "arguments": {
      "coachId": "64b64c0f2f5f4c0012345678",
      "message": "Hi coach, I finished today's session — knee felt fine!"
    }
  }
}
```
