MCP inventory tutorial
Use IQM Model Context Protocol (MCP) to interact with the Inventory API.
Overview
This tutorial guides you through using IQM MCP to retrieve and manage inventory details for your campaigns. You learn how to create and manage deals, assign them to campaigns, and create inventory groups using the MCP interface.
Before you begin
To create a deal or inventory group, the following are required:
- An account on the IQM platform
- See Before you begin to create an account and request a Client ID and Client Secret
- A campaign
- See Create a campaign quickstart guide
- See Create a PG campaign tutorial
- Required for assigning a deal/group to a campaign
About IQM inventory
The Inventory API allows you to manage inventory details for your campaigns, including creating and managing deals, assigning them to campaigns, and creating inventory groups.
More resources
- Inventory API guidelines
- Create a deal tutorial
- Optimize your inventory tutorial
- Ad inventory and placements Help Center article
Create a PMP deal
You can use IQM MCP to create a PMP deal by providing the required details and settings.
| Prompt | Response example | Notes |
|---|---|---|
| Help me create a new PMP deal | MCP prompts user for PMP deal details and settings. | |
| Show me a list of PMP deals | ||
| Delete PMP deal 2349 | MCP updates PMP deal's status to 'inactive' and then deletes it. |
Create a PG deal
You can also use IQM MCP to create a PG deal by providing the required details and settings.
| Prompt | Response example | Notes |
|---|---|---|
| Help me create a new PG deal | MCP prompts user for PG deal details and settings. | |
| Show me a list of PG deals | ||
| Assign PGdeal1 to campaign 594259 | MCP assigns PG deal to the specified campaign. | |
| Delete PG deals 1934 and 1933 | MCP deletes the specified PG deals. |
Create an inventory group
You can use IQM MCP to create an inventory group and add inventory to it.
| Prompt | Response example | Notes |
|---|---|---|
| I want to create an inventory group of PMP deals | MCP prompts user for inventory group details and deal IDs to add to it. | |
| Update that group. Remove PMP deal 449 and add 1587 and 1757 | MCP updates the mapping of deals to the inventory group. | |
| I want to create a new inventory group using Contextual inventories | MCP prompts user for Contextual inventory details and keywords to add to the group. | |
| Create an inventory group with the following filters: country id: 30100001 category: IAB1 exchanges: 47,48 traffictypes: 11, 12 | MCP creates an inventory group with the specified filters. | |
| Assign Filter Group 1 to the following campaigns: 594254, 594256, 594257 | MCP uses a campaign targeting tool to assign the inventory group. See the campaign Tools index for more information. |
Tools index
The table below lists the tools that MCP uses in this tutorial, with links to their API documentation. For every Inventory API tool available in MCP, see the Inventory API section of the Tools index.
| Tool name | Description | Documentation |
|---|---|---|
addPMPDeal | Create a new PMP deal | Create PMP deal |
getPMPDealList | Get a paginated list of PMP deals | Get PMP deals list |
editPMPDeal | Edit an existing PMP deal | Update PMP deal |
deletePMPDeal | Delete one or more PMP deals | Delete PMP deal |
addPGDeal | Create a new PG deal | Create PG deal |
fetchPGDealList | Get a paginated list of PG deals | Get PG deals list |
managePgDealCampaignMappings | Bulk assign/de-assign PG deals to campaigns | Assign PG deals |
deletePGDeals | Delete multiple PG deals by their IDs | Delete PG deal |
addInventoryGroup | Create a new inventory group | Create a new inventory group |
addMappingsToInventoryGroups | Add inventories to one or more inventory groups | Add or remove mappings to an inventory group |
removeMappingsOfInventoryGroup | Remove inventories from an inventory group | Add or remove mappings to an inventory group |
includeExcludeInventoryGroup | Include or exclude campaigns from one or more inventory groups | Include/exclude campaigns from inventory groups |