# Formilla MCP MCP

> Formilla MCP connects your AI agent directly to your live chat data, letting you manage customer records without logging into the Formilla dashboard. Use it to instantly pull up visitor profiles, update contact details, and review conversation history right from your preferred client.

## Overview
- **Category:** customer-support
- **Price:** Free
- **Tags:** real-time-chat, lead-qualification, in-app-messaging, customer-data, chatbot, contact-management

## Description

This connector lets you take control of your customer data using natural conversation. Instead of manually logging into Formilla's chat dashboard every time a lead comes in, your AI agent acts as the direct data coordinator. It reads out visitor profiles, checks support histories, and updates contact info like names or phone numbers instantly. If you need to find specific user attributes—say, confirming their plan type—the agent handles that lookup. You can also pull lists of all contacts or even delete records when required for compliance. This level of granular data access means your AI doesn't just chat; it manages the entire customer relationship lifecycle, giving you full control over data management right from within Vinkius.

## Tools

### check_formilla_status
Verifies that your connection to Formilla is active and working correctly.

### delete_contact
Removes a specific contact record from the system entirely.

### get_contact_by_email
Looks up and returns all details associated with a specific customer email address.

### get_contact
Retrieves detailed information for a known contact using their unique identifier.

### get_conversation
Pulls the entire transcript of a single chat conversation for review.

### list_contacts
Returns a list and summary view of every contact record in your account.

### list_conversations
Provides an index of all recorded chat threads, allowing you to see recent activity.

### list_segments
Retrieves a list of predefined user groups or marketing segments.

### list_visitors
Lists the IP addresses and basic details of people who visited your site.

### search_contacts
Searches across contact fields (like names or attributes) to find relevant user records.

### update_contact
Changes specific data points for an existing contact, such as their phone number or name.

### upsert_contact
Creates a brand new contact record or updates an existing one using the same command.

## Prompt Examples

**Prompt:** 
```
List all my current contacts in Formilla.
```

**Response:** 
```
I've retrieved your contact list. You have 150 registered users. Recent additions include 'John Doe' (john@example.com) and 'Sarah Smith'. Would you like to check the details for any specific contact?
```

**Prompt:** 
```
Update contact 'john@example.com' with phone '+15551234567'.
```

**Response:** 
```
Done! I've updated the phone number for John Doe (john@example.com) in your Formilla account. The new details are now synced and available in your chat dashboard.
```

**Prompt:** 
```
Find the contact details for 'sarah.smith@example.com'.
```

**Response:** 
```
I've located Sarah Smith's profile (ID: frm_987). She is an active user with 3 past chat interactions. Her current attributes include 'Plan: Premium' and 'Region: US'. Shall I retrieve her full history?
```

## Capabilities

### Fetch and Filter Customer Profiles
Find specific contact details by email or list all registered users in your system.

### Manage Contact Data
Create new records or update existing user information, including names, phone numbers, and emails.

### Review Conversation History
Retrieve the full text and metadata for past chat interactions between a customer and your support team.

### List System Data Sets
Access lists of all contacts, conversations, or defined user segments within Formilla.

### Maintain Data Hygiene
Programmatically delete contact records when they are no longer needed or requested by privacy law.

## Use Cases

### A new lead comes in via chat, but we need their company info.
The agent uses `get_contact_by_email` to check if the email exists. If it does, it pulls up their history using `get_conversation`. Then, it runs `upsert_contact` with the new company name so the sales team has the latest details.

### We need to clean out old user data for GDPR compliance.
The Ops Manager asks the agent to list all contacts (`list_contacts`) and then triggers `delete_contact` for records older than two years, keeping the database clean.

### A marketing campaign needs a list of high-value customers.
The marketer uses `list_segments` to identify users marked 'Premium' and then runs `search_contacts` for those users who haven't logged in recently, creating an action list.

### We need to update the phone number for a key account.
Instead of manually editing the dashboard, the agent uses `update_contact`, specifying the user ID and the new number. The change is instantly reflected in all systems.

## Benefits

- Stop losing time on data entry. The `upsert_contact` tool lets your agent automatically create or fix user records just by knowing the email address.
- Deep dive into customer history instantly. Use `get_conversation` to retrieve full chat transcripts, giving agents all context needed before replying.
- Handle compliance requests easily. When a user asks you to delete their data, simply use `delete_contact` to remove them programmatically.
- Better lead tracking means better sales. You can run searches using `search_contacts` to find users who match specific criteria or attributes.
- Stay on top of your base. Use `list_segments` and `list_visitors` together to understand who is engaging with your site versus who is just a contact record.

## How It Works

The bottom line is, your AI client talks directly to Formilla’s database, giving you immediate access to customer records without ever opening a browser tab.

1. First, connect your Formilla account to Vinkius and retrieve the necessary API Auth Token from your Formilla dashboard.
2. Next, give your AI client permission to use this MCP. Your agent can then send natural language requests, like 'Find John Doe's history.'
3. The system executes the command, pulling live data—like updated phone numbers or segment memberships—and presenting it back to you via your chat interface.

## Frequently Asked Questions

**How does the Formilla MCP use get_contact_by_email?**
It fetches all stored details for a user based purely on their email address. This is faster than searching, and it's perfect for quickly confirming if an old lead record still exists.

**Can I use list_contacts to see every single person?**
Yes, `list_contacts` gives you a summary of your entire contact base. If the number is huge and you only want people from last month, run `search_contacts` instead for better filtering.

**What’s the difference between update_contact and upsert_contact?**
`update_contact` assumes the record exists and changes specific fields. `upsert_contact` is safer; it will create a new record if one doesn't exist or update it if it does.

**How do I check my connection status with the Formilla MCP?**
You use the `check_formilla_status` tool. It simply verifies your credentials and tells you whether the connection is live or requires a token refresh.

**If I need to remove a user record, how does the `delete_contact` tool handle data retention policies?**
The tool immediately and permanently removes the contact record from your Formilla account. This action is final; it ensures compliance by wiping all associated metadata and history for that specific user ID.

**What information does `get_conversation` retrieve when I need context on a customer's issue?**
It returns the full chat transcript, including timestamps, the sequence of messages, and which participants were involved. This allows your agent to understand the entire flow of conversation for accurate follow-up.

**Beyond email, what filters can I use when running `search_contacts`?**
You can narrow your search using custom attributes, specific behavioral tags, or by defining a date range. This lets you find contacts based on criteria like 'High Value' or 'Last 30 Days'.

**When I use `list_segments`, what kind of customer groupings do I get access to?**
It provides a list of predefined segments—groups built around shared traits, such as product plan level or geography. You can use these segment names to refine your understanding of user cohorts.

**How do I find my API Auth Token in Formilla?**
Log in to your Formilla dashboard, navigate to **Settings** > **Security**, and copy your unique API Auth Token.

**Can I use the agent to sync my existing user IDs?**
Yes! The `upsert_contact` tool accepts a `UserId` parameter specifically designed to link your internal system identifiers with Formilla records.

**Does it support deleting multiple contacts at once?**
The `delete_contact` tool operates on a single contact ID at a time. To delete multiple records, your agent can iterate through a list of IDs programmatically.