# Create a group chat with the Fifteen MCP server

Fifteen runs an MCP server inside the app, so an agent can drive it directly:
search the user's chats, read conversations, send messages, and create groups.
This skill covers `create_group`.

## Prerequisites

- Fifteen installed and **running** (see [install.md](./install.md)). The MCP
  server lives inside the app — if the app is closed, there is nothing to
  connect to.
- The MCP server registered with your agent. Fifteen shows the exact command
  under **Preferences → Developer**, with a button to copy it:

  ```sh
  claude mcp add --transport http fifteen http://127.0.0.1:15151/mcp
  ```

  The port is configurable in that same panel; `15151` is the default.

- The target platform signed in. For Telegram, check with `service_status`:

  ```json
  { "name": "service_status", "arguments": {} }
  ```

  Note it reports only Telegram, Signal and Slack — **not WhatsApp**. The way to
  confirm WhatsApp is ready is to `search_chats` for a known contact and see
  whether a `whatsapp_contact:` id comes back. If it doesn't, `create_group`
  returns `no connected WhatsApp account` and creates nothing.

## Which platforms support this

| Platform | Create a group? |
| -------- | --------------- |
| Telegram | ✅ |
| WhatsApp | ✅ |
| Signal   | ❌ the Signal library Fifteen uses can only read groups, not create them |
| Slack    | ❌ a Slack group is a channel, and Fifteen doesn't create channels |
| iMessage | ❌ a group starts by sending to several people at once — nothing to create up front |
| Email    | ❌ no groups; address several recipients instead |

Calling `create_group` for an unsupported platform fails immediately with a
message saying which one and why. It never half-creates anything.

## Create a group

1. **Find the members.** `create_group` takes social ids, not names, so resolve
   each person with `search_chats` first:

   ```json
   { "name": "search_chats", "arguments": { "query": "Alice" } }
   ```

   Every result carries a `social_id`. Use it **verbatim** — don't reconstruct
   or edit it.

   ```json
   [
     { "title": "Alice Martins", "social_id": "telegram_user:12345" },
     { "title": "Alice Martins", "social_id": "whatsapp_contact:351900000000%40s.whatsapp.net/351911111111%40s.whatsapp.net" }
   ]
   ```

   ⚠️ **The same person often appears on several platforms.** This is where you
   choose which platform the group is created on — see the next step.

2. **Create the group.**

   ```json
   {
     "name": "create_group",
     "arguments": {
       "title": "Weekend trip",
       "members": ["telegram_user:12345", "telegram_user:67890"]
     }
   }
   ```

   There is **no `platform` argument**. The members decide it: a
   `telegram_user:` id makes a Telegram group, a `whatsapp_contact:` id makes a
   WhatsApp one. That is why picking the right search result in step 1 matters.

   Pass *people*, not chats. `telegram_user:` and `whatsapp_contact:` are
   people; `telegram_chat:` and `whatsapp_group:` are existing conversations and
   are rejected.

   You never list the user themselves — they are always in the group they
   create.

   The reply is the new group's own id:

   ```json
   { "social_id": "telegram_chat:-4712345678", "title": "Weekend trip" }
   ```

3. **Send the first message**, using that id directly:

   ```json
   {
     "name": "send_message",
     "arguments": {
       "social_id": "telegram_chat:-4712345678",
       "text": "Made a group for the trip planning"
     }
   }
   ```

## Optional arguments

- **`auto_delete_seconds`** — a disappearing-message timer, honoured by both
  Telegram and WhatsApp. Omit it, or pass `0`, to leave it off.

  ```json
  { "title": "Standup", "members": ["telegram_user:12345"], "auto_delete_seconds": 86400 }
  ```

- **`from`** — the account to create from, for platforms where the user has
  several connected (Telegram). Omit it to use that platform's default account.
  Account ids come from `service_status`.

## Errors

All of these arrive before anything is created, so a failed call is safe to fix
and retry.

| Message | What to do |
| ------- | ---------- |
| `a group can't span platforms: some members are on Telegram, others on WhatsApp` | Go back to `search_chats` and pick results on **one** platform for every member. |
| `can't put a Telegram group or channel in a group` | You passed a conversation id where a person's id belongs. |
| `a group needs at least one other member` | `members` was empty. |
| `a group needs a name` | `title` was empty or whitespace. |
| `can't create Signal groups: …` | Not supported — see the table above. |
| `no connected Telegram account` | That platform isn't signed in. Check `service_status`. |

## Tips

- The group appears in the user's sidebar on its own; you don't need to do
  anything to make it show up.
- `create_group` waits for the server to assign the group its id, so a
  successful reply means the group really exists — unlike `send_message`, which
  reports that a message was *dispatched*.
- Creating a group twice with the same name creates two groups. There is no
  deduplication, so confirm with the user before retrying a call whose result
  you didn't see.
- On WhatsApp, a contact the user has never messaged may fail to resolve to a
  phone number. Pick a contact from `search_chats` results rather than
  constructing a JID by hand.
