# Swarm MCP

> Swarm manages your entire customer loyalty lifecycle. Connect it to any AI agent to let them handle points, rewards, and vouchers through simple chat commands. Check balances with `get_customer_balance`, award points via `process_loyalty_transaction`, or redeem rewards using `redeem_customer_reward`. It's the single point of control for retail customer retention.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** loyalty-programs, rewards-management, customer-retention, point-systems, transaction-processing, customer-engagement

## Description

Swarm handles your entire customer loyalty lifecycle, letting your AI agent manage points, rewards, and vouchers through simple chat commands. You don't build complex APIs or write backend logic; you just talk to your agent.

### Managing Customer Loyalty with Swarm

*   **Check Point Balances:** Your agent checks a specific customer's current loyalty point balance and tier status using `get_customer_balance`. This tool gives immediate, real-time data on exactly how many points the customer has accumulated and what their corresponding loyalty tier is.
*   **Processing Sales and Awarding Points:** You register sale amounts and product details to automatically add points to a client's account via `process_loyalty_transaction`. When an agent runs this tool, it requires specific data—the total sale value, the products purchased, and the customer ID—and then executes the point award instantly.
*   **Reviewing Customer Vouchers:** Your agent lists every active discount code or voucher assigned to a particular customer profile using `list_customer_vouchers`. This gives you a clean rundown of all unused credits available on that account.
*   **Browsing Rewards Catalog:** You can list all current, redeemable rewards and check which ones a customer qualifies for with `list_available_rewards`. The agent pulls the full catalog so you're always up-to-date on what customers can actually trade their points for.
*   **Managing Reward Redemptions:** Your agent handles the conversion of accumulated customer points into actual goods or discount vouchers using `redeem_customer_reward`. When a redemption happens, it doesn't just give the reward—it deducts the necessary funds from the customer's total point balance, keeping your records accurate.

This single system gives you full control over the entire customer retention process. Your AI agent uses these specialized tools to handle everything: first, checking eligibility by running `get_customer_balance`; then, confirming options by calling `list_available_rewards` and reviewing existing credits with `list_customer_vouchers`; next, processing a sale using `process_loyalty_transaction`; and finally, completing the transaction by executing `redeem_customer_reward`. You'll manage every point award, reward list query, balance check, voucher review, and final redemption right from the chat interface. It’s your single source of truth for customer loyalty.

## Tools

### get_customer_balance
Checks a specific customer's current loyalty point balance and tier status.

### list_available_rewards
Retrieves a list of all rewards that customers can currently redeem points for.

### list_customer_vouchers
Lists and queries every unused discount voucher associated with a customer account.

### process_loyalty_transaction
Registers a sale amount and product data to automatically award points to the specified customer.

### redeem_customer_reward
Converts a customer's accumulated points into a chosen reward or voucher, deducting funds from their balance.

## Prompt Examples

**Prompt:** 
```
What is the point balance for customer 'cust_10293'?
```

**Response:** 
```
I've retrieved the balance. Customer cust_10293 currently has 1,250 points and is in the 'Gold Tier'. They are eligible for a 15% discount voucher. Would you like to redeem it now?
```

**Prompt:** 
```
Award points for a $150 purchase to customer 'cust_88231'.
```

**Response:** 
```
Transaction processed! I've awarded the points for a $150.00 sale to customer cust_88231. Their new balance is now 1,400 points. The customer has been notified via email.
```

**Prompt:** 
```
Show me all available rewards I can claim with 500 points.
```

**Response:** 
```
Fetching reward catalog... With 500 points, you can claim: 'Free Coffee' (200 pts), '10% Discount Code' (400 pts), or 'Sticker Pack' (150 pts). Which one would you like to redeem?
```

## Capabilities

### Check Point Balances
The agent retrieves a customer's current point total and loyalty tier status using `get_customer_balance`.

### Process Sales and Award Points
It registers sale data (products, amounts) to automatically add points to a client's account via `process_loyalty_transaction`.

### Manage Reward Redemptions
The agent executes the conversion of customer points into actual rewards or discount vouchers using `redeem_customer_reward`.

### Browse Rewards Catalog
You can list all current, redeemable rewards and check which ones a customer qualifies for with `list_available_rewards`.

### Review Customer Vouchers
The agent lists every active discount code or voucher assigned to a specific customer profile using `list_customer_vouchers`.

## Use Cases

### Customer asks about their points right before checkout
A customer calls and asks, 'How many points do I have?' Your agent uses `get_customer_balance` to pull the live data. The agent responds by confirming the balance and suggesting a reward they qualify for, solving the inquiry in one chat turn.

### Staff needs to award points after an unusual sale
A store employee rings up a large corporate gift card sale that doesn't fit standard product codes. Instead of manually logging it, they instruct the agent to run `process_loyalty_transaction` with the specific total and product details, ensuring immediate point accrual.

### Marketing needs to check redemption options for a group
The marketing team wants to know what rewards are available if customers have between 400-600 points. They ask the agent to run `list_available_rewards`, which provides an instant, actionable list of redeemable items.

### Completing a manual reward exchange
A customer wants to use their 1,200 points for a specific jacket. Instead of going through the web portal, the agent runs `redeem_customer_reward` and confirms the deduction, completing the transaction instantly.

## Benefits

- Check point balances instantly. Running `get_customer_balance` lets your agent retrieve real-time point totals and tier status for any customer ID, which is critical right before checkout.
- Handle transactions without touching a dashboard. The `process_loyalty_transaction` tool takes sale data and awards points automatically, making the entire process conversational.
- Keep track of every discount. By using `list_customer_vouchers`, your agent can show exactly what unused codes are tied to a customer's profile, eliminating confusion.
- Simplify redemption flows. The `redeem_customer_reward` tool lets you convert points into actual rewards or vouchers with just a few prompts, bypassing multi-step forms.
- Full catalog visibility. You don't have to guess what customers can buy; running `list_available_rewards` shows the entire current reward catalog for eligibility checks.

## How It Works

The bottom line is, you manage your entire loyalty program conversationally; the AI handles the API calls in the background.

1. Subscribe to the Swarm server and enter your API Key into your AI client.
2. Tell your agent what you need—for example, 'Check points for cust_10293' or 'Award 50 points for $50 sale.'
3. The agent runs the necessary tool (like `get_customer_balance` or `process_loyalty_transaction`) and returns a natural language response with the results.

## Frequently Asked Questions

**How do I check a customer's point balance using get_customer_balance?**
You ask your agent for the specific customer ID and request their balance. The tool uses `get_customer_balance` to pull real-time data, letting you know their points total and current loyalty tier instantly.

**What does process_loyalty_transaction actually do?**
This tool automatically registers a sale's amount and product details. When the agent runs it, it calculates and awards the appropriate number of points to the customer's account.

**Can I use list_available_rewards to see point costs?**
Yes, `list_available_rewards` provides a structured catalog. It lets you see what rewards are currently available and how many points they cost before attempting any redemption.

**How do I redeem points for a reward using redeem_customer_reward?**
You simply ask the agent to redeem the specific item, providing your customer ID. The `redeem_customer_reward` tool executes the deduction and updates both the customer's balance and their status.

**What does using list_customer_vouchers help me see?**
It shows all unused discount codes tied to a customer's profile. This tool lets you query and review specific voucher assignments, helping you ensure the right credits are available for redemption.

**What happens if I use process_loyalty_transaction with bad data?**
The server validates all inputs, including sale amounts and product identifiers. If any piece of data fails validation, the tool immediately throws an error message telling you exactly which field needs correcting.

**Do I need a special key to run get_customer_balance?**
Yes, connecting requires your Swarm API Key. This key authenticates your session and gives the agent permission to read real-time point balances for any customer ID.

**Can I use list_available_rewards for a batch of customers?**
No, `list_available_rewards` is designed to show general catalog details and doesn't take customer IDs. You must first check the individual customer balance using `get_customer_balance` before checking eligibility.

**Can I check a customer's points balance via AI?**
Yes! Use the `get_customer_balance` tool and provide the Customer ID. Your agent will retrieve the current points and the loyalty tier for that specific user.

**How do I award points for a recent purchase using the agent?**
Use the `process_loyalty_transaction` action. Provide the Customer ID and the transaction amount. The agent will instantly calculate and award the correct points based on your Swarm settings.

**Is it possible to list all the rewards a customer can claim?**
Absolutely. Use the `list_available_rewards` query and provide the Customer ID. The agent will return the catalog of rewards that the user is currently eligible to redeem.