Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GAM_MCP_HOST | No | Server host (HTTP mode only) | 0.0.0.0 |
| GAM_MCP_PORT | No | Server port (HTTP mode only) | 8000 |
| GAM_NETWORK_CODE | Yes | Ad Manager network code | |
| GAM_MCP_TRANSPORT | No | Transport mode: stdio or http | stdio in Docker, http otherwise |
| GAM_MCP_AUTH_TOKEN | No | Authentication token (HTTP mode only). Auto-generated if not set | |
| GAM_CREDENTIALS_PATH | Yes | Path to service account JSON |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_delivering_orders | List all orders with line items currently delivering ads. Returns a list of orders with their delivering line items, including impression and click statistics. |
| get_order | Get order details by ID or name. Args: order_id: The order ID (optional if order_name provided) order_name: The order name to search for (optional if order_id provided) Returns order details including all line items. |
| create_order | Create a new order for an advertiser. Args: order_name: Name for the new order advertiser_id: ID of the advertiser company Returns the created order details. |
| find_or_create_order | Find an existing order by name or create a new one. Args: order_name: Name of the order advertiser_id: ID of the advertiser company Returns the existing or newly created order. |
| get_line_item | Get line item details by ID. Args: line_item_id: The line item ID Returns line item details including status, dates, and statistics. |
| create_line_item | Create a new line item for an order. Args: order_id: The order ID to add line item to name: Line item name end_year: End date year (e.g., 2025) end_month: End date month (1-12) end_day: End date day (1-31) target_ad_unit_id: Ad unit ID to target (find via GAM UI or ad unit tools) line_item_type: Type of line item. Valid types: - SPONSORSHIP: Guaranteed, time-based (100% share of voice) - STANDARD: Guaranteed, goal-based (specific number of impressions) - NETWORK: Non-guaranteed, run-of-network - BULK: Non-guaranteed, volume-based - PRICE_PRIORITY: Non-guaranteed, competes on price - HOUSE: Internal/house ads (lowest priority) - CLICK_TRACKING: For tracking clicks only - ADSENSE: AdSense backfill - AD_EXCHANGE: Ad Exchange backfill - BUMPER: Short video bumper ads - PREFERRED_DEAL: Programmatic preferred deals goal_impressions: Impression goal (default: 100000) creative_sizes: JSON string of sizes, e.g. '[{"width": 300, "height": 250}, {"width": 728, "height": 90}]' If not provided, uses defaults: 300x250, 300x600, 728x90, 1000x250 cost_per_unit_micro: Cost per unit in micro amounts (e.g., 1000000 = 1 MAD) currency_code: Currency code (default: MAD) Returns the created line item details. |
| duplicate_line_item | Duplicate an existing line item. Args: source_line_item_id: ID of the line item to duplicate new_name: Name for the new line item rename_source: Optional new name for the source line item Returns both the source and new line item details. |
| update_line_item_name | Update a line item's name. Args: line_item_id: The line item ID new_name: New name for the line item Returns the updated line item details. |
| list_line_items_by_order | List all line items for an order. Args: order_id: The order ID Returns list of line items with their status and statistics. |
| pause_line_item | Pause a delivering line item. Pausing stops the line item from delivering ads. The line item can be resumed later with resume_line_item. Args: line_item_id: The line item ID to pause Returns the result of the pause action including new status. |
| resume_line_item | Resume a paused line item. Resuming allows a previously paused line item to start delivering ads again based on its schedule and targeting. Args: line_item_id: The line item ID to resume Returns the result of the resume action including new status. |
| archive_line_item | Archive a line item. Archived line items are hidden from the default UI views but can still be retrieved via API. This is useful for cleaning up old campaigns. Note: This action cannot be undone via API. Args: line_item_id: The line item ID to archive Returns the result of the archive action including new status. |
| approve_line_item | Approve a line item that requires approval. This is used when the approval workflow is enabled in Google Ad Manager. Line items in NEEDS_APPROVAL status can be approved to allow delivery. Args: line_item_id: The line item ID to approve Returns the result of the approve action including new status. |
| upload_creative | Upload an image creative to Ad Manager. Args: file_path: Path to the image file advertiser_id: ID of the advertiser click_through_url: Destination URL when clicked creative_name: Optional name for the creative override_size_width: Optional width to override the creative size (for serving into a different sized slot) override_size_height: Optional height to override the creative size (for serving into a different sized slot) The creative size is extracted from the filename (e.g., '300x250' in 'banner_300x250.png'). Use override_size_width and override_size_height together to serve a creative into a different sized placement (e.g., serve a 970x250 image into a 1000x250 slot). Returns the created creative details. |
| associate_creative_with_line_item | Associate a creative with a line item. Args: creative_id: The creative ID line_item_id: The line item ID size_override_width: Optional width for size override size_override_height: Optional height for size override Returns the association details. |
| upload_and_associate_creative | Upload a creative and associate it with a line item in one step. Args: file_path: Path to the image file advertiser_id: ID of the advertiser line_item_id: ID of the line item click_through_url: Destination URL when clicked creative_name: Optional name for the creative Returns the creative and association details. |
| bulk_upload_creatives | Upload all creatives from a folder and associate with a line item. Args: folder_path: Path to folder containing image files advertiser_id: ID of the advertiser line_item_id: ID of the line item click_through_url: Destination URL when clicked name_prefix: Optional prefix for creative names Supported formats: jpg, jpeg, png, gif. Returns results for all uploads. |
| get_creative | Get creative details by ID. Args: creative_id: The creative ID Returns creative details including size and destination URL. |
| list_creatives_by_advertiser | List creatives for an advertiser. Args: advertiser_id: The advertiser ID limit: Maximum number of creatives to return (default: 100) Returns list of creatives. |
| update_creative | Update an existing creative's properties. Args: creative_id: The creative ID to update destination_url: New destination/click-through URL for the creative name: New name for the creative At least one of destination_url or name must be provided. Returns the updated creative details. |
| list_creatives_by_line_item | List creatives associated with a line item. Args: line_item_id: The line item ID limit: Maximum number of creatives to return (default: 100) Returns list of creatives with their association status. |
| get_creative_preview_url | Get a preview URL for a creative associated with a line item. This generates a preview URL that shows how the creative will appear on the specified site URL. The preview URL loads the site with the creative displayed in its ad slots. Args: line_item_id: The line item ID creative_id: The creative ID site_url: The URL of the site where you want to preview the creative (e.g., "https://abc.com") Returns the preview URL that can be opened in a browser. |
| create_third_party_creative | Create a third-party creative (HTML/JavaScript ad tag). Use this for DCM/Campaign Manager tags, custom HTML ads, or any third-party ad server tags that need to be served through Google Ad Manager. Args: advertiser_id: ID of the advertiser name: Name for the creative width: Creative width in pixels height: Creative height in pixels snippet: The HTML/JavaScript code snippet (the ad tag) expanded_snippet: Optional expanded snippet for expandable creatives is_safe_frame_compatible: Whether the creative works in SafeFrame (default: True) Returns the created creative details. |
| find_advertiser | Find an advertiser by name (partial match). Args: name: Advertiser name to search for Returns list of matching advertisers. |
| get_advertiser | Get advertiser details by ID. Args: advertiser_id: The advertiser/company ID Returns advertiser details. |
| list_advertisers | List all advertisers. Args: limit: Maximum number of advertisers to return (default: 100) Returns list of advertisers. |
| create_advertiser | Create a new advertiser. Args: name: Advertiser name email: Optional email address address: Optional address Returns the created advertiser details. |
| find_or_create_advertiser | Find an advertiser by exact name or create if not found. Args: name: Exact advertiser name email: Optional email (used if creating) Returns the existing or newly created advertiser. |
| verify_line_item_setup | Verify line item setup including creative placeholders and associations. Args: line_item_id: The line item ID to verify Checks:
Returns verification results with any issues found. |
| check_line_item_delivery_status | Check detailed delivery status for a line item. Args: line_item_id: The line item ID to check Returns delivery progress including impressions, clicks, and goal progress. |
| verify_order_setup | Verify complete order setup including all line items. Args: order_id: The order ID to verify Returns comprehensive verification of the order and all its line items. |
| run_delivery_report | Run a delivery report for orders and line items. Returns impressions, clicks, CTR, and revenue broken down by order and line item. Args: date_range_type: Date range for the report. Valid values: - TODAY, YESTERDAY, LAST_WEEK, LAST_MONTH, LAST_3_MONTHS, REACH_LIFETIME - CUSTOM_DATE (requires start and end date parameters) start_year: Start date year (required if date_range_type is CUSTOM_DATE) start_month: Start date month 1-12 (required if date_range_type is CUSTOM_DATE) start_day: Start date day 1-31 (required if date_range_type is CUSTOM_DATE) end_year: End date year (required if date_range_type is CUSTOM_DATE) end_month: End date month 1-12 (required if date_range_type is CUSTOM_DATE) end_day: End date day 1-31 (required if date_range_type is CUSTOM_DATE) order_id: Optional order ID to filter by line_item_id: Optional line item ID to filter by include_date_breakdown: If True, includes daily breakdown (default: True) timeout_seconds: Maximum time to wait for report (default: 120) Returns report data with impressions, clicks, CTR, and revenue statistics. |
| run_inventory_report | Run an inventory report for ad units. Returns ad requests, impressions, and fill rate broken down by ad unit. Args: date_range_type: Date range for the report (TODAY, YESTERDAY, LAST_WEEK, etc.) start_year: Start date year (for CUSTOM_DATE) start_month: Start date month 1-12 (for CUSTOM_DATE) start_day: Start date day 1-31 (for CUSTOM_DATE) end_year: End date year (for CUSTOM_DATE) end_month: End date month 1-12 (for CUSTOM_DATE) end_day: End date day 1-31 (for CUSTOM_DATE) ad_unit_id: Optional ad unit ID to filter by include_date_breakdown: If True, includes daily breakdown (default: True) timeout_seconds: Maximum time to wait for report (default: 120) Returns report data with ad requests, impressions, and fill rate statistics. |
| run_custom_report | Run a custom report with specified dimensions and metrics. Args: dimensions: JSON array of dimension names, e.g. '["DATE", "ORDER_NAME", "LINE_ITEM_NAME"]' Valid dimensions: DATE, WEEK, MONTH_AND_YEAR, ORDER_ID, ORDER_NAME, LINE_ITEM_ID, LINE_ITEM_NAME, LINE_ITEM_TYPE, CREATIVE_ID, CREATIVE_NAME, CREATIVE_SIZE, ADVERTISER_ID, ADVERTISER_NAME, AD_UNIT_ID, AD_UNIT_NAME columns: JSON array of metric names, e.g. '["TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS"]' Valid metrics: TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS, TOTAL_LINE_ITEM_LEVEL_CLICKS, TOTAL_LINE_ITEM_LEVEL_CTR, TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE, TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE, TOTAL_INVENTORY_LEVEL_IMPRESSIONS, TOTAL_AD_REQUESTS, TOTAL_RESPONSES_SERVED, TOTAL_FILL_RATE date_range_type: Date range (TODAY, YESTERDAY, LAST_WEEK, LAST_MONTH, LAST_3_MONTHS, REACH_LIFETIME, CUSTOM_DATE) start_year: Start year for CUSTOM_DATE range start_month: Start month (1-12) for CUSTOM_DATE range start_day: Start day (1-31) for CUSTOM_DATE range end_year: End year for CUSTOM_DATE range end_month: End month (1-12) for CUSTOM_DATE range end_day: End day (1-31) for CUSTOM_DATE range filter_statement: Optional filter (e.g., "ORDER_ID = 12345") timeout_seconds: Maximum seconds to wait for report completion Returns report data with specified dimensions and metrics. |
| create_campaign | Create a complete campaign: find/create advertiser, order, line item, and upload creatives. Args: advertiser_name: Name of the advertiser order_name: Name for the order line_item_name: Name for the line item end_year: End date year end_month: End date month (1-12) end_day: End date day (1-31) creatives_folder: Path to folder containing creative images click_through_url: Destination URL for all creatives target_ad_unit_id: Ad unit ID to target (find via GAM UI or ad unit tools) goal_impressions: Impression goal (default: 100000) line_item_type: Type of line item (STANDARD, SPONSORSHIP, NETWORK, BULK, PRICE_PRIORITY, HOUSE, etc.) creative_sizes: JSON string of sizes, e.g. '[{"width": 300, "height": 250}, {"width": 728, "height": 90}]' This is a complete workflow that:
Returns complete campaign creation results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |