# Sunwise MCP — Workflow Prompts

Use these prompts with any MCP-compatible client (ChatGPT, Claude, Cursor, etc.)
to guide the AI through multi-step Sunwise operations in the correct order.

Invoke a workflow by name or paste the relevant section into your conversation.

---

## `onboarding_workflow`
**Use when:** A new project needs to be created (contact may already exist or be new).

Follow these steps in order. Do not skip or reorder them.

**Step 1 — Resolve contact**
Call `search_contacts` with the contact's name or email.
- If found: use the returned `contact_id`. Skip to Step 2.
- If not found: call `create_contact` with `name` (required) and `email` (required).

**Step 2 — Create project**
Call `create_project` with the `contact_id` and a `project_name`.
Note the returned `project_id`.

**Step 3 — Configure project energy**
Call `create_energies_without_consumptions` with the `project_id` and a valid
Mexican postal code (`zip_code`). Required before any proposal can be created.
- "Consumption data already exists" → treat as success, continue.
- Zip code not recognized → ask the user for a valid one and retry.

**Step 4 — Select preset (optional)**
Call `get_presets_list` and present options. User may choose a template or skip.

**Step 5 — Create proposal(s)**
Call `create_proposal` with the `project_id` and a `name`.
Repeat for each proposal requested.
- Fails with "project not configured" → return to Step 3.
- Never create a different project as a workaround.

---

## `create_proposals_for_project`
**Use when:** The project already exists and the user wants to add proposals.

**Step 1 — Select preset (optional)**
Call `get_presets_list` and present options. User may choose a template or skip.

**Step 2 — Create proposal(s)**
Call `create_proposal` with the `project_id` and a `name`.
Repeat for each proposal requested.

**If Step 2 fails with "project not configured":**
1. Ask the user for the project's `zip_code` (valid Mexican postal code).
2. Call `create_energies_without_consumptions` with the same `project_id` and zip_code.
   - "Consumption data already exists" → treat as success.
   - Zip code not recognized → ask for a valid one and retry.
3. Retry `create_proposal`.

Never create a new project as a workaround. Always configure the existing one.

---

## `add_financing_to_proposal`
**Use when:** Adding a financing plan to an existing proposal.

**Step 1 — Confirm business type**
Confirm `business_type` with the user before calling any tool:
- `"person_company"` — company associated with an individual.
- `"company"` — standalone corporate entity.
- `"physical_person"` — individual person.

**Step 2 — Get financing options**
Call `get_financing_options_for_proposal` with `proposal_id` and confirmed `business_type`.
Present the returned financiers and products to the user.

**Step 3 — User selects a plan**
Ask the user to choose a financier, product, and term from Step 2 results.

**Step 4 — Create financing plan**
Call `create_financing_in_proposal` with:
- `proposal_id` (same as Step 2)
- `financier_id`, `financier_product_id`, `term` (from Step 3 selection)

All IDs must come from Step 2 results. Never fabricate or guess IDs.

---

## `create_report_for_project`
**Use when:** Generating a report for a project from its electrical bill history.

**Step 1 — Retrieve historical bills**
Call `get_historical_electrical_bills` with the `project_id`.
- Empty result / `available: false` → inform the user that no bills exist.
  Bills must be uploaded in Sunwise first. Stop — do not retry.
- Records returned → present them to the user.

**Step 2 — Confirm selection**
If multiple records exist, ask the user which one to use. Note the `history_id`.

**Step 3 — Create report**
Call `create_report` with `project_id`, `history_id`, and a confirmed `report_name`.

---

*Sunwise MCP Server — https://production.sunwise.ai/boty/mcp*
