inventory
Manage ad unit hierarchy in Google Ad Manager: traverse tree, audit issues, batch create, generate blueprints, and sync.
Instructions
Manage GAM ad unit inventory — tree traversal, audit, batch creation, ads.txt, and blueprint sync.
MODE: mixed (read + write) AUTH: OAuth 2.0 required CREDITS: Reads = 0. Writes = 0.5–1 credit. OUTPUT: get_ad_unit_tree returns a hierarchical JSON of ad units. audit_inventory returns an analysis report. create_ad_units_batch returns a list of {requested_name, created_id, status}. SIDE EFFECTS: push_inventory_blueprint creates or updates ad units in GAM based on the stored blueprint. archive_inactive_ad_units is destructive and cannot be undone. WHEN TO USE: Use inventory for ad unit structure management. Use targeting for custom targeting keys. Use blueprint for the canonical format/position definition that drives inventory creation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Sub-operation to perform: • get_ad_unit_tree: Return the full ad unit hierarchy as a nested JSON tree. Read-only. • audit_inventory: Analyze the inventory for structural issues: orphaned ad units, duplicate sizes, missing placements. Read-only. • create_ad_units_batch: Create multiple ad units in one call from a specification list. Write. • generate_ads_json: Generate an ads.json / app-ads.json file from the current inventory. Read-only. • generate_inventory_blueprint: Generate a blueprint JSON from existing GAM inventory (reverse-engineering). Read-only. • push_inventory_blueprint: Push the stored blueprint to GAM, creating or updating ad units. Write, 1 credit. • get_ad_units_by_ids: Retrieve multiple ad units by ID in one call. Read-only. • find_inactive_ad_units: Find ad units with no recent impressions. Read-only. • archive_inactive_ad_units: Archive ad units flagged as inactive. Destructive write. Run find_inactive_ad_units first. • list_ad_unit_sizes: List all sizes used across ad units on the network. Read-only. | |
| network_code | No | GAM network code (e.g. 12345678). Required for all network-scoped operations. Obtain via select_gam_network or list_accessible_networks. |