# NiftyImages MCP

> NiftyImages connects dynamic content into your AI workflow. Manage personalized images, track widget performance, and update countdown timers directly from your agent—no need to open the web portal. Use it to list assets, pull click stats, or programmatically change Photoshop layers in real time.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** dynamic-content, personalized-images, countdown-timers, email-personalization, engagement-tracking, web-widgets

## Description

This server lets your AI agent handle all your dynamic content—images, widgets, and timers—without you ever having to open up a web portal. You're managing personalized assets directly from chat. It’s built for people who need to act fast and don't have time clicking through dashboards.

**Managing Your Content Assets**

You can get an overview of everything you've set up. Use `list_images` to pull a list of every single personalized image asset in your account. Similarly, running `list_widgets` gives you a full inventory of all the dynamic widgets available for use across your content. For deeper dives into specific assets, you can run `get_image` to retrieve the complete configuration and details for one particular personalized image. If you need to know exactly what data points are in play, `list_datastore_fields` shows you the names and types of all fields within a specified personalization data store. You'll also use `get_image_stats` to pull performance metrics, like impressions and clicks, for any given image asset. To track widget performance, you run `get_widget_stats`, which fetches aggregated statistics—including impressions and clicks—for your dynamic widgets.

**Updating Live Content**

You don't just read data; you change it. You can programmatically modify editable layers within Photoshop-designed images using `update_psd_image`. If you have a countdown timer, `update_timer` lets you set a new target end date and time instantly. For your personalization data, you can write to the system by calling `add_datastore_record`, which adds a brand-new record into your specified data store. When a data point is retired or corrupted, use `delete_datastore_record` to remove an existing record from a specific data store.

**The System View**

These tools give you total control over the backend operations of your content. You can retrieve all necessary asset metadata and configuration using these functions. Every piece of personalized content—be it an image, widget, or timer—is accessible for inspection and modification via the agent.

*Here’s what happens when you run these tools:* 

* **List Assets:** Run `list_images` and `list_widgets` to see every configured element. 
* **Inspect Metadata:** Use `get_image` with a unique Image Key to pull the full asset configuration. 
* **Track Performance:** Get concrete metrics for specific images via `get_image_stats`, or check widget performance using `get_widget_stats`. 
* **Manipulate Data:** View available fields with `list_datastore_fields`; add data records with `add_datastore_record` or clear old ones with `delete_datastore_record`. 
* **Change Content:** Update Photoshop layers directly via `update_psd_image`, change deadlines using `update_timer`, and manage the core content by listing available assets.

## Tools

### add_datastore_record
Adds a new record into your specified personalization data store.

### delete_datastore_record
Removes an existing record from a specific data store.

### get_image_stats
Fetches performance metrics, including impressions and clicks, for a given image.

### get_image
Retrieves the full details and configuration for one personalized image asset.

### get_widget_stats
Retrieves performance data (impressions/clicks) for dynamic widgets in your content.

### list_datastore_fields
Shows the names and types of all available fields within a specific data store.

### list_images
Lists every personalized image asset currently set up in your account.

### list_widgets
Retrieves a list of all dynamic widgets available for use across your web and email content.

### update_psd_image
Updates specific layers within an existing Photoshop-designed image asset.

### update_timer
Sets a new target end date and time for a countdown timer.

## Prompt Examples

**Prompt:** 
```
List all the personalized images in my NiftyImages account.
```

**Response:** 
```
Retrieving your images... I found 12 personalized images, including 'Welcome Banner' (Key: img_123), 'Abandoned Cart Promo', and 'Birthday Surprise'. Would you like the performance stats for the Welcome Banner?
```

**Prompt:** 
```
Update the countdown timer 'SaleEnd' to expire on December 25th, 2024 at midnight.
```

**Response:** 
```
Target date update initiated... The timer 'SaleEnd' (Key: timer_987) has been successfully updated. It is now set to expire on 2024-12-25 00:00:00. All users opening the email from now on will see the new deadline.
```

**Prompt:** 
```
Show me the impression and click stats for all my images.
```

**Response:** 
```
Fetching image statistics... Your assets have generated a total of 1.2M impressions and 45K clicks this month. The 'Promo Banner' is your top performer with a 5.2% click-through rate. Shall I provide the breakdown for the dynamic widgets as well?
```

## Capabilities

### List all NiftyImages assets
Retrieves a list of every personalized image and widget configured in your account.

### Track content performance metrics
Pulls aggregated statistics—like impressions and clicks—for specific images or widgets.

### Update dynamic deadlines
Changes the target end date and time for any active countdown timer asset.

### Manage personalization data
Allows you to list fields, add new records, or delete custom data points used by your content.

### Update image layers
Programmatically modifies specific editable layers within Photoshop-designed images.

### Inspect asset metadata
Fetches full configuration and metadata for a single asset using its unique Image Key.

## Use Cases

### The last-minute sale update
A campaign manager needs a promotion timer (SaleEnd) to expire two days early. Instead of logging into NiftyImages, they prompt their agent: 'Change the SaleEnd timer to end 2024-11-15.' The agent uses `update_timer` and confirms the new date immediately.

### Debugging poor banner performance
An analyst notices a specific promo banner (Key: img_xyz) isn't getting clicks. They ask their agent to run `get_image_stats`. The agent returns 1,500 impressions but only 3 clicks, pointing the user straight to the problem.

### Fixing stale data fields
The creative team realizes a custom field ('CustomerTier') is missing records for a batch of new users. They use `list_datastore_fields` to check structure, then run `add_datastore_record` using the correct schema to populate the needed user data.

### Rapid creative iteration
The copywriter changes a key value proposition. Instead of waiting for design to re-export, they tell their agent: 'Update layer 3 in img_xyz with the new text.' The agent executes `update_psd_image` and pushes the change immediately.

## Benefits

- Update deadlines instantly. Use `update_timer` to change a sale end date without logging into the portal or emailing a developer. You just tell your agent when it needs to expire.
- See real performance data fast. Running `get_image_stats` gives you immediate impressions and click counts for any asset, letting you know what’s working right now.
- Manage personalization records directly. The tools like `add_datastore_record` let you update the source data that feeds your content, fixing bad inputs before they hit an email send.
- Update creative assets on the fly. Need to change a headline in a banner ad? Call `update_psd_image`. It modifies specific layers inside Photoshop-designed images programmatically.
- Inventory check. Use `list_images` and `list_widgets` to get a clean inventory of every asset you own, without clicking through dozens of internal dashboards.
- Data control. You can use `list_datastore_fields` first, then confidently call `add_datastore_record` to ensure the data structure is correct before adding any records.

## How It Works

The bottom line is this: You talk to your AI client like talking to a coworker; it handles the API calls to NiftyImages for you.

1. First, you subscribe to the NiftyImages server and provide your API Key.
2. Next, you tell your AI agent what you need—for example: 'Get the stats for my welcome banner.'
3. The agent calls the appropriate tool (like `get_image_stats`), runs the query against NiftyImages, and returns the raw data to you.

## Frequently Asked Questions

**How do I find out what personalized images are available using list_images?**
The `list_images` tool returns every personalized image you have configured. This gives you the names and unique keys needed to run other tools, like getting stats.

**Can I update a countdown timer date with the update_timer tool?**
Yes. The `update_timer` tool lets you change the target end date and time for an active timer asset. You just need to specify the key and the new expiration details.

**What is the difference between get_image_stats and get_widget_stats?**
These tools track different types of content performance. Use `get_image_stats` for static or image-based assets, and use `get_widget_stats` for dynamic widgets embedded in your web pages.

**Does add_datastore_record require knowing the fields first?**
Yes. Before adding a record, you should run `list_datastore_fields` to see exactly what data points are expected and confirm the correct schema for your personalization data.

**What security precautions should I take before using the `delete_datastore_record` tool?**
The system confirms deletion immediately. Because this action is irreversible, always run a pre-check query first to verify which records you plan to remove. You'll want to confirm both the record ID and the target data store name before executing the delete command.

**How does the `update_psd_image` tool programmatically change Photoshop layers?**
This tool allows you to update specific, named layers within your design. You must provide both the Image Key and the exact layer name, along with the new content or data for that layer. It bypasses manual editing by targeting defined programmatic layers.

**Are there rate limits I should know about when calling `get_image_stats` and `get_widget_stats`?**
Yes, high-volume requests are subject to API throttling. We recommend batching your statistics calls whenever possible rather than making many rapid single lookups. Always check the official NiftyImages documentation for current rate limits.

**What data does `list_widgets` return about my dynamic widgets?**
`list_widgets` returns a simple list of all active widget IDs and names associated with your account. It's useful for inventory but doesn't provide performance metrics; you need to use the dedicated stats tool for engagement data.

**Where do I find my NiftyImages API Key?**
Log in to your NiftyImages account and navigate to the API section in your account settings to find or generate your key.

**Can I update a timer that is already live in an email?**
Yes! Because NiftyImages generates the countdown at the moment the email is opened, updating the target date via the `update_timer` tool will reflect the change for all subsequent opens.

**What is the Photoshop API used for?**
It allows you to programmatically change the text or visibility of specific layers within a Photoshop file you have uploaded to NiftyImages, enabling high-fidelity dynamic imaging.