---
name: frepi-platform
description: "Operate the Frepi Platform through its MCP server (mcp.frepi.ai): WhatsApp marketing campaigns, templates, lines, audiences, broadcast delivery diagnosis, Analysis Studio tags and conversation windows, SQL analytics, dashboards and reports. Use when the user asks to launch, schedule or check a campaign or broadcast; create, submit or fix a WhatsApp template; choose a line or fuente; build an audience or etiqueta; explain why messages failed (Meta 131049, 132000, #200, Enviado vs Entregado); tag conversations or build a report; query data or build a dashboard. Spanish triggers: campaña, difusión, envío masivo, plantilla, línea, fuente, audiencia, etiqueta, conversaciones, ventana, tablero, informe, reporte, lanza, programa, por qué falló. Also use when a Frepi tool returns ok:false with an error_code or help_topic, or PROJECT_ID_REQUIRED, FEATURE_DISABLED or ACCESS_DENIED."
license: "Proprietary. Free to use with a Frepi account. See LICENSE."
compatibility: "Requires the Frepi Platform MCP server (https://mcp.frepi.ai/mcp/) via the claude.ai connector (OAuth) or a bipk_ API key."
metadata:
  author: "frepi-ai"
  version: "1.0.0"
---

# Frepi Platform

Operate one workspace on the Frepi Platform MCP server: marketing sends, templates, Analysis Studio, and SQL analytics. Read the matching reference before a write.

## Connect

Use the claude.ai connector (OAuth) or an API key:

```
claude mcp add --transport http frepi https://mcp.frepi.ai/mcp/ --header "Authorization: Bearer bipk_…"
```

OAuth stores nothing: pass `project_id` on every call. A `bipk_` key is bound to one workspace. Create keys with `POST /api/auth/api-keys`.

No local files? Every `references/<x>.md` is also `bi_help("<x>")` on the HTTP server. `bi_help("skill")` returns this playbook.

## The project rule

1. `bi_list_projects`.
2. Pass that `project_id` on every call, including parallel chats.
3. Check `project.display_name` before a write.

OAuth writes without `project_id` fail with `PROJECT_ID_REQUIRED` now. OAuth reads without it fail the same way from 2026-10-09. API keys fall back to the bound workspace. `bi_use_project` only verifies on OAuth; it re-binds an API key. Never guess a project.

## Routing

| Task | Sequence |
| --- | --- |
| Analytics query or dashboard | `bi_list_tables` → `bi_describe_table` → `bi_query` → `bi_save_query` → `bi_create_dashboard` / `bi_add_widget` |
| Published report | `create_bi_report` prompt → `bi_publish_report` |
| Campaign now | `list_etiquetas` → `preview_audience` → `create_audience` → `list_templates` → `create_broadcast_draft` → confirm count → `launch_campaign` |
| Scheduled campaign | `list_etiquetas` → `preview_audience` → `create_audience` → `list_templates` → confirm count **and send time** → `create_broadcast_draft` with `scheduled_at` (this schedules a real send; the cron fires it without `launch_campaign`) |
| Template, text or media | `list_template_variables` → `create_template` → (`request_template_image_upload` when the header is media) → `submit_template` |
| Delivery diagnosis | `get_broadcast` → `failure_breakdown` → `bi_help(help_topic)` |
| Analysis Studio tagging | `bi_create_tag` → `bi_preview_keyword_rule` → `bi_add_keyword_rule` → `bi_run_tagging_backfill` → `bi_tag_report` |

## Critical rules

- `launch_campaign` sends immediately. Preview the audience and confirm the recipient count with the operator. There is no second confirmation step.
- Never relaunch a failed broadcast. Fix the cause and create a new draft.
- Lines that send through Respond.io accept POSITIONAL templates only. When unsure, use POSITIONAL. Named variables fail with `named_params_unsupported`.
- `create_broadcast_draft` with `scheduled_at` is a real, scheduled send. Confirm the recipient count and time with the operator before that call.
- `phone_number_id` is the Frepi fuente UUID from `list_phone_numbers`, never the provider phone id.
- `131049` (healthy ecosystem engagement) is a per-recipient marketing cap. It is not retryable and it is not an account outage.
- `submit_template` is a real submission for approval.
- Never guess a project. Read `project.display_name` on the result.

## When you are stuck

- Follow the `help_topic` on the error with `bi_help` before escalating.
- If that topic does not fix it, or the operator asks, call `report_problem`.
- Write `summary`, `what_i_tried`, and `expected` in the operator's language. Never paste credentials or phone numbers.
- Give the operator the `reference`. If the report itself fails, tell them to write to support@frepi.ai. Do not file another report.

## Envelopes

| Field | How to act |
| --- | --- |
| `ok` | `false` means stop and read `error_code` / `help_topic`. |
| `error_code` | Machine token. Open `bi_help(help_topic)` when present. |
| `help_topic` | A `bi_help` slug, sometimes `slug#anchor`. |
| `category` | `user_input`: change the input and retry. `needs_config`: escalate, do not retry. `transient`: wait and retry. `state`: wrong status — new draft or wait. |
| `retryable` | When `false`, do not call the same tool again unchanged. |
| `project` | Every result that reached a project echoes `project`; project-resolution errors do not. Abort the write if `display_name` is unexpected. |

## References

- [analytics.md](references/analytics.md)
- [analysis-studio.md](references/analysis-studio.md)
- [campaigns.md](references/campaigns.md)
- [charts.md](references/charts.md)
- [connect.md](references/connect.md)
- [dashboards.md](references/dashboards.md)
- [delivery-errors.md](references/delivery-errors.md)
- [errors.md](references/errors.md)
- [lines.md](references/lines.md)
- [projects.md](references/projects.md)
- [saved-queries.md](references/saved-queries.md)
- [sql-performance.md](references/sql-performance.md)
- [templates.md](references/templates.md)
- [widget-parameters.md](references/widget-parameters.md)
- [windows.md](references/windows.md)
