# Ometria Intelligence MCP

> Ometria Intelligence connects your AI agent directly to your customer data platform. You can query deep insights into contacts, order history, product catalogs, and marketing campaigns using natural language. Use tools like `list_contacts`, `get_order_details`, or `get_campaign_stats` to pull structured data without leaving your chat interface.

## Overview
- **Category:** ecommerce
- **Price:** Free
- **Tags:** customer-data, retail-marketing, segmentation, customer-lifecycle, crm-data

## Description

Connect your AI agent straight into Ometria's customer data platform. You don't have to jump back and forth; you just tell your agent what you need, and it pulls structured, actionable data from your system right in the chat window.

When you use this server, you’re talking directly to your core business intelligence. It lets you analyze contacts, track specific orders, check product inventory, narrow down audience groups, and measure campaign performance—all using natural language prompts.

### Analyzing Customer Contacts

You can start by pulling a full list of every contact defined in Ometria using `list_contacts`. If you know the unique ID for one user, you use `get_contact_details` to pull their entire profile. This gives you deep insight into everything attached to that single customer record.

For marketing targeting, you can generate a complete list of all audience segments with `list_customer_segments`. Once you have a segment's ID, the tool `get_segment_details` pulls detailed membership criteria and tells you exactly how many people are in that group. You're always checking who belongs to which target pool.

### Tracking Transactions and Orders

You need to know what’s happening with your sales funnel? First, run `list_orders` to get a list of recent customer transactions across the entire system. If you want deep background on one specific sale, use `get_order_details`. This pulls all metadata for that order, including its current status and contents.

### Checking Product Inventory Details

The tools let you manage your product side without leaving the agent interface. You can get a list of every single item available in your e-commerce catalog using `list_catalog_products`. To check specific details—like stock levels, pricing, or weights—for any given ID, use `get_product_details`.

### Running Marketing Campaign Reports

To measure marketing efforts, you start by listing everything. You can pull a list of all current and past campaigns run through the platform via `list_marketing_campaigns`. When you need hard numbers on performance metrics—like open rates or automation usage for specific campaigns—you use `get_campaign_stats` to retrieve that real-time data.

### How It Works Under the Hood

The process is simple: your agent figures out what tool it needs based on your prompt. If you ask, 'What are the details for order XYZ and who lives in segment ABC?', the server executes `get_order_details` and `get_segment_details` sequentially. It then packages all that structured data up and sends it back to your agent. You get clean JSON objects—no messy CSVs, no manual exports—just pure data ready for immediate analysis by your AI client.

## Tools

### get_campaign_stats
Retrieves current performance metrics for specific marketing campaigns.

### get_contact_details
Pulls detailed information about a single customer contact using their unique ID.

### get_order_details
Gets the full metadata and status updates for one specific order.

### get_product_details
Fetches comprehensive details, including stock info, for a single product in the catalog.

### get_segment_details
Retrieves detailed membership information and criteria for a specific audience segment.

### list_marketing_campaigns
Lists all current and past marketing campaigns run through the platform.

### list_contacts
Provides a list of contacts defined within the Ometria platform.

### list_orders
Retrieves a list of recent customer orders across the entire system.

### list_catalog_products
Lists all products available in your entire e-commerce catalog.

### list_customer_segments
Generates a complete list of audience segments defined for marketing use.

## Prompt Examples

**Prompt:** 
```
List all active marketing campaigns.
```

**Response:** 
```
Retrieving campaigns... I found 12 active campaigns including 'Spring Sale 2024', 'Welcome Automation', and 'VIP Loyalty Program'. Would you like the engagement stats for the Spring Sale?
```

**Prompt:** 
```
What is the status of order ID 'ord_98765'?
```

**Response:** 
```
Inspecting order ord_98765... The order is currently 'Shipped' and was placed yesterday. It contains 3 items totaling $145.00. Shall I list the contact details for the customer who placed this order?
```

**Prompt:** 
```
Show me the details for the 'High LTV' segment.
```

**Response:** 
```
Fetching segment details... The 'High LTV' segment currently contains 1,250 members. This audience consists of customers who have placed at least 5 orders in the last 12 months. Would you like to see the recent order history for this group?
```

## Capabilities

### Analyze Customer Contacts
Pull specific contact information, segment membership, or general lists of users from your Ometria platform.

### Track Transaction History
Retrieve detailed records for customer orders and list recent transactions to check status and contents.

### Inventory Product Details
List all items in your catalog and get specific metadata, like stock levels or pricing, for any product ID.

### Assess Audience Size
Fetch lists of defined audience segments and determine the exact member count for targeted groups.

### Measure Campaign Performance
Get real-time engagement statistics for marketing campaigns, including email opens or automation usage.

## Use Cases

### Investigating an unusual order status
A customer calls about their purchase. You ask your agent to check the order ID. The agent uses `get_order_details` to confirm the item and status, then runs `get_contact_details` to pull the buyer’s name and email for a quick follow-up.

### Building a new high-value target list
Marketing needs all 'High LTV' customers. The agent first calls `list_customer_segments` to find the segment ID, then uses `get_segment_details` to verify membership and size, giving you the exact count needed for an email send.

### Comparing recent campaigns
You need to know if the 'Summer Sale' campaign was more effective than 'Welcome Series'. Your agent calls `list_marketing_campaigns` to list both, then runs `get_campaign_stats` for each name to compare engagement data instantly.

### Validating a new product launch
Operations needs to confirm the pricing and stock of item 'X.' They run `list_catalog_products` to verify existence, then use `get_product_details` to get the specific metadata they need before listing it on the site.

## Benefits

- Instantly check segment sizes. Instead of navigating to the segmentation tab, just run `list_customer_segments` and get member counts immediately.
- Streamlined order checks. You can use `get_order_details` with a single ID to see status, items, and totals without clicking through multiple pages.
- Deep product visibility. Use `get_product_details` to validate inventory or pricing metadata against real-time stock levels—crucial for e-commerce ops.
- Full campaign insights. Running `list_marketing_campaigns` followed by `get_campaign_stats` gives you a full performance breakdown in one go.
- Contact data on demand. With `list_contacts`, your agent pulls all necessary contact details, letting you build targeted lists instantly.

## How It Works

The bottom line is, your AI client handles all the complex API calls; you just ask a question using natural language.

1. Subscribe to the server and input your Ometria API Key (`X-Ometria-Auth`) into your client settings.
2. Prompt your AI agent with a question (e.g., 'Show me segment sizes for High LTV customers').
3. The agent calls the required tool(s) (like `list_customer_segments` and then `get_segment_details`), and you receive structured data in response.

## Frequently Asked Questions

**How do I use list_contacts to find customer details?**
You first run `list_contacts` to get a list of IDs or names. Then, you pass a specific ID to `get_contact_details` to pull the full profile and segment information for that single person.

**Can I use get_order_details to check product stock?**
No, not directly. `get_order_details` gives transaction history and item SKUs. To check current stock levels, you must pass the SKU from the order details into `get_product_details`.

**What is the difference between list_orders and get_order_details?**
`list_orders` shows a summary of recent orders (IDs, dates). Use it to find an ID. Then you pass that specific ID to `get_order_details` to see everything: items, status updates, etc.

**Do I need list_customer_segments before checking segment size?**
Yes. You must first call `list_customer_segments` to get the name or ID of the target segment. Then you pass that identifier into `get_segment_details` to retrieve the count and members.

**When I use get_contact_details, what authentication method is required?**
You must provide a valid Ometria API Key in the request header. The system validates this key to ensure your agent has access. If the token expires or the scope is wrong, you'll receive an explicit 401 Unauthorized error.

**What happens if I try to run get_segment_details too many times in a row?**
The server enforces rate limits to protect your account. If you exceed the allowed calls per minute, subsequent requests will fail with a 429 Too Many Requests error. You'll need to pause and retry later.

**When listing products using list_catalog_products, can I filter by specific attributes?**
Yes, you pass filters directly in the query parameters. For instance, you can request items only belonging to a certain category ID or those marked 'Active'. This keeps your results tight.

**If the Order ID I provide to get_order_details doesn't exist, how should I handle it?**
The tool returns a clear error message stating that no records match the provided ID. The JSON response will typically include an 'Error: Not Found' payload, letting your agent know immediately.

**How do I get an Ometria API Key?**
You can generate an API key in the Ometria settings dashboard under the API tab. This key should be used for the `X-Ometria-Auth` header.

**Can I see customer lifetime value (LTV)?**
Yes! Use the `get_contact_details` tool with a specific contact ID to retrieve their full profile, which includes segment associations and calculated lifetime metrics.

**Does this support real-time campaign stats?**
Yes, the `get_campaign_stats` tool retrieves current engagement metrics directly from Ometria for any specific campaign ID.