Skip to main content
Glama
ghl-mcp-server-v2

ghl-mcp-server-v2

by zackscriven

ghl_ad_fb_adset_upsert

Idempotent

Create or update a Facebook ad set, configuring targeting, budget, and placements for ad campaigns.

Instructions

Upsert adset Create or update a Facebook ad set Endpoint: PUT /ad-publishing/facebook/adsets (Version header: v3; source: v3/ad-publishing-v3.json) OAuth scopes: adPublishing.write

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "body": "<body>"
    },
    "name": "ghl_ad_fb_adset_upsert"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesRequest body (schema carried verbatim from the official OpenAPI spec).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.1.0
    • changedInput schema / properties / body / properties / audience / allOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "ageMax": {
      -        "description": "Maximum age for targeting",
      -        "example": 65,
      -        "type": "number"
      -      },
      -      "ageMin": {
      -        "description": "Minimum age for targeting",
      -        "example": 18,
      -        "type": "number"
      -      },
      -      "genders": {
      -        "description": "Gender targeting (1 = male, 2 = female)",
      -        "example": [
      -          1,
      -          2
      -        ],
      -        "items": {
      -          "type": "number"
      -        },
      -        "type": "array"
      -      },
      -      "geoLocations": {
      -        "description": "Geographic locations to target or exclude",
      -        "example": [
      -          {
      -            "key": "US",
      -            "name": "United States",
      -            "selectionType": "include",
      -            "type": "country"
      -          },
      -          {
      -            "key": "2421836",
      -            "name": "New York",
      -            "radius": 25,
      -            "radiusUnit": "mile",
      -            "selectionType": "include",
      -            "type": "city"
      -          }
      -        ],
      -        "items": {
      -          "properties": {
      -            "geometry": {
      -              "allOf": [
      -                {
      -                  "properties": {
      -                    "location": {
      -                      "description": "Geographic coordinates",
      -                      "example": {
      -                        "lat": 40.7128,
      -                        "lng": -74.006
      -                      },
      -                      "type": "object"
      -                    },
      -                    "locationType": {
      -                      "description": "Geocoding result type",
      -                      "example": "APPROXIMATE",
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "location",
      -                    "locationType"
      -                  ],
      -                  "type": "object"
      -                }
      -              ],
      -              "description": "Geometry data for address-based targeting",
      -              "example": {
      -                "location": {
      -                  "lat": 40.7128,
      -                  "lng": -74.006
      -                },
      -                "locationType": "APPROXIMATE"
      -              }
      -            },
      -            "key": {
      -              "description": "Facebook location key",
      -              "example": "US",
      -              "type": "string"
      -            },
      -            "name": {
      -              "description": "Location display name",
      -              "example": "United States",
      -              "type": "string"
      -            },
      -            "radius": {
      -              "description": "Targeting radius around the location (for city/address types)",
      -              "example": 25,
      -              "type": "number"
      -            },
      -            "radiusUnit": {
      -              "description": "Unit for the targeting radius",
      -              "enum": [
      -                "km",
      -                "mi"
      -              ],
      -              "example": "mi",
      -              "type": "string"
      -            },
      -            "selectionType": {
      -              "description": "Whether the location is included or excluded from targeting",
      -              "enum": [
      -                "include",
      -                "exclude"
      -              ],
      -              "example": "include",
      -              "type": "string"
      -            },
      -            "type": {
      -              "description": "Geographic location type",
      -              "enum": [
      -                "country",
      -                "city",
      -                "region",
      -                "country_group",
      -                "geo_market",
      -                "large_geo_area",
      -                "medium_geo_area",
      -                "small_geo_area",
      -                "subcity",
      -                "neighborhood",
      -                "zip",
      -                "address"
      -              ],
      -              "example": "country",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "key",
      -            "name",
      -            "type",
      -            "selectionType"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "interests": {
      -        "description": "Interest-based targeting criteria",
      -        "example": [
      -          {
      -            "id": "6003139266461",
      -            "name": "Fitness and wellness",
      -            "type": "interests"
      -          }
      -        ],
      -        "items": {
      -          "properties": {
      -            "id": {
      -              "description": "Interest ID",
      -              "example": "6003139266461",
      -              "type": "string"
      -            },
      -            "name": {
      -              "description": "Interest name",
      -              "example": "Fitness and wellness",
      -              "type": "string"
      -            },
      -            "type": {
      -              "description": "Interest category type (defaults to \"interests\" if omitted)",
      -              "example": "interests",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "name"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "locales": {
      -        "description": "Language locales to target",
      -        "example": [
      -          {
      -            "key": 6,
      -            "name": "English (US)"
      -          }
      -        ],
      -        "items": {
      -          "properties": {
      -            "key": {
      -              "description": "Facebook locale key",
      -              "example": 6,
      -              "type": "number"
      -            },
      -            "name": {
      -              "description": "Locale display name",
      -              "example": "English (US)",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "name",
      -            "key"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "lookalike": {
      -        "description": "Lookalike audiences to target",
      -        "example": [
      -          {
      -            "id": "23851234567890",
      -            "name": "Lookalike - Website Visitors"
      -          }
      -        ],
      -        "items": {
      -          "properties": {
      -            "id": {
      -              "description": "Custom audience ID",
      -              "example": "23851234567890",
      -              "type": "string"
      -            },
      -            "name": {
      -              "description": "Custom audience name",
      -              "example": "Website Visitors - Last 30 Days",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "name"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "placementType": {
      -        "description": "Placement strategy — \"auto\" lets Facebook choose, \"manual\" uses the placements config",
      -        "enum": [
      -          "auto",
      -          "manual"
      -        ],
      -        "example": "auto",
      -        "type": "string"
      -      },
      -      "placements": {
      -        "allOf": [
      -          {
      -            "properties": {
      -              "facebook": {
      -                "description": "Facebook placement positions",
      -                "example": [
      -                  "feed",
      -                  "right_hand_column",
      -                  "marketplace"
      -                ],
      -                "items": {
      -                  "type": "string"
      -                },
      -                "type": "array"
      -              },
      -              "instagram": {
      -                "description": "Instagram placement positions",
      -                "example": [
      -                  "stream",
      -                  "story",
      -                  "explore"
      -                ],
      -                "items": {
      -                  "type": "string"
      -                },
      -                "type": "array"
      -              },
      -              "messenger": {
      -                "description": "Messenger placement positions",
      -                "example": [
      -                  "messenger_home"
      -                ],
      -                "items": {
      -                  "type": "string"
      -                },
      -                "type": "array"
      -              }
      -            },
      -            "type": "object"
      -          }
      -        ],
      -        "description": "Ad placement positions per platform (only used when placementType is \"manual\")",
      -        "example": {
      -          "facebook": [
      -            "feed"
      -          ],
      -          "instagram": [
      -            "story"
      -          ],
      -          "messenger": [
      -            "messenger_home"
      -          ]
      -        }
      -      },
      -      "retargeting": {
      -        "description": "Retargeting custom audiences to target",
      -        "example": [
      -          {
      -            "id": "23851234567891",
      -            "name": "Website Visitors - Last 30 Days"
      -          }
      -        ],
      -        "items": {
      -          "properties": {
      -            "id": {
      -              "description": "Custom audience ID",
      -              "example": "23851234567890",
      -              "type": "string"
      -            },
      -            "name": {
      -              "description": "Custom audience name",
      -              "example": "Website Visitors - Last 30 Days",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "name"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "geoLocations"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "ageMax": {
      +        "description": "Maximum age for targeting",
      +        "example": 65,
      +        "type": "number"
      +      },
      +      "ageMin": {
      +        "description": "Minimum age for targeting",
      +        "example": 18,
      +        "type": "number"
      +      },
      +      "genders": {
      +        "description": "Gender targeting (1 = male, 2 = female)",
      +        "example": [
      +          1,
      +          2
      +        ],
      +        "items": {
      +          "type": "number"
      +        },
      +        "type": "array"
      +      },
      +      "geoLocations": {
      +        "description": "Geographic locations to target or exclude",
      +        "example": [
      +          {
      +            "key": "US",
      +            "name": "United States",
      +            "selectionType": "include",
      +            "type": "country"
      +          },
      +          {
      +            "key": "2421836",
      +            "name": "New York",
      +            "radius": 25,
      +            "radiusUnit": "mile",
      +            "selectionType": "include",
      +            "type": "city"
      +          }
      +        ],
      +        "items": {
      +          "properties": {
      +            "countryCode": {
      +              "description": "ISO 3166-1 alpha-2 code of the country the location is in. Used to declare Meta regional regulated categories (e.g. Singapore, Taiwan).",
      +              "example": "US",
      +              "type": "string"
      +            },
      +            "countryName": {
      +              "description": "Name of the country the location is in",
      +              "example": "United States",
      +              "type": "string"
      +            },
      +            "geometry": {
      +              "allOf": [
      +                {
      +                  "properties": {
      +                    "location": {
      +                      "description": "Geographic coordinates",
      +                      "example": {
      +                        "lat": 40.7128,
      +                        "lng": -74.006
      +                      },
      +                      "type": "object"
      +                    },
      +                    "locationType": {
      +                      "description": "Geocoding result type",
      +                      "example": "APPROXIMATE",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "location",
      +                    "locationType"
      +                  ],
      +                  "title": "AudienceLocationGeometry",
      +                  "type": "object"
      +                }
      +              ],
      +              "description": "Geometry data for address-based targeting",
      +              "example": {
      +                "location": {
      +                  "lat": 40.7128,
      +                  "lng": -74.006
      +                },
      +                "locationType": "APPROXIMATE"
      +              }
      +            },
      +            "key": {
      +              "description": "Facebook location key",
      +              "example": "US",
      +              "type": "string"
      +            },
      +            "name": {
      +              "description": "Location display name",
      +              "example": "United States",
      +              "type": "string"
      +            },
      +            "radius": {
      +              "description": "Targeting radius around the location (for city/address types)",
      +              "example": 25,
      +              "type": "number"
      +            },
      +            "radiusUnit": {
      +              "description": "Unit for the targeting radius",
      +              "enum": [
      +                "km",
      +                "mi"
      +              ],
      +              "example": "mi",
      +              "type": "string"
      +            },
      +            "selectionType": {
      +              "description": "Whether the location is included or excluded from targeting",
      +              "enum": [
      +                "include",
      +                "exclude"
      +              ],
      +              "example": "include",
      +              "type": "string"
      +            },
      +            "type": {
      +              "description": "Geographic location type",
      +              "enum": [
      +                "country",
      +                "city",
      +                "region",
      +                "country_group",
      +                "geo_market",
      +                "large_geo_area",
      +                "medium_geo_area",
      +                "small_geo_area",
      +                "subcity",
      +                "neighborhood",
      +                "zip",
      +                "address"
      +              ],
      +              "example": "country",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "key",
      +            "name",
      +            "type",
      +            "selectionType"
      +          ],
      +          "title": "AudienceLocationDTO",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "interests": {
      +        "description": "Interest-based targeting criteria",
      +        "example": [
      +          {
      +            "id": "6003139266461",
      +            "name": "Fitness and wellness",
      +            "type": "interests"
      +          }
      +        ],
      +        "items": {
      +          "properties": {
      +            "id": {
      +              "description": "Interest ID",
      +              "example": "6003139266461",
      +              "type": "string"
      +            },
      +            "name": {
      +              "description": "Interest name",
      +              "example": "Fitness and wellness",
      +              "type": "string"
      +            },
      +            "type": {
      +              "description": "Interest category type (defaults to \"interests\" if omitted)",
      +              "example": "interests",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "id",
      +            "name"
      +          ],
      +          "title": "AudienceInterestDTO",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "locales": {
      +        "description": "Language locales to target",
      +        "example": [
      +          {
      +            "key": 6,
      +            "name": "English (US)"
      +          }
      +        ],
      +        "items": {
      +          "properties": {
      +            "key": {
      +              "description": "Facebook locale key",
      +              "example": 6,
      +              "type": "number"
      +            },
      +            "name": {
      +              "description": "Locale display name",
      +              "example": "English (US)",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "name",
      +            "key"
      +          ],
      +          "title": "AudienceLocaleDTO",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "lookalike": {
      +        "description": "Lookalike audiences to target",
      +        "example": [
      +          {
      +            "id": "23851234567890",
      +            "name": "Lookalike - Website Visitors"
      +          }
      +        ],
      +        "items": {
      +          "properties": {
      +            "id": {
      +              "description": "Custom audience ID",
      +              "example": "23851234567890",
      +              "type": "string"
      +            },
      +            "name": {
      +              "description": "Custom audience name",
      +              "example": "Website Visitors - Last 30 Days",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "id",
      +            "name"
      +          ],
      +          "title": "AudienceCustomAudienceItemDTO",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "placementType": {
      +        "description": "Placement strategy — \"auto\" lets Facebook choose, \"manual\" uses the placements config",
      +        "enum": [
      +          "auto",
      +          "manual"
      +        ],
      +        "example": "auto",
      +        "type": "string"
      +      },
      +      "placements": {
      +        "allOf": [
      +          {
      +            "properties": {
      +              "facebook": {
      +                "description": "Facebook placement positions",
      +                "example": [
      +                  "feed",
      +                  "right_hand_column",
      +                  "marketplace"
      +                ],
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "instagram": {
      +                "description": "Instagram placement positions",
      +                "example": [
      +                  "stream",
      +                  "story",
      +                  "explore"
      +                ],
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "messenger": {
      +                "description": "Messenger placement positions",
      +                "example": [
      +                  "messenger_home"
      +                ],
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "title": "AudiencePlacementsDTO",
      +            "type": "object"
      +          }
      +        ],
      +        "description": "Ad placement positions per platform (only used when placementType is \"manual\")",
      +        "example": {
      +          "facebook": [
      +            "feed"
      +          ],
      +          "instagram": [
      +            "story"
      +          ],
      +          "messenger": [
      +            "messenger_home"
      +          ]
      +        }
      +      },
      +      "retargeting": {
      +        "description": "Retargeting custom audiences to target",
      +        "example": [
      +          {
      +            "id": "23851234567891",
      +            "name": "Website Visitors - Last 30 Days"
      +          }
      +        ],
      +        "items": {
      +          "properties": {
      +            "id": {
      +              "description": "Custom audience ID",
      +              "example": "23851234567890",
      +              "type": "string"
      +            },
      +            "name": {
      +              "description": "Custom audience name",
      +              "example": "Website Visitors - Last 30 Days",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "id",
      +            "name"
      +          ],
      +          "title": "AudienceCustomAudienceItemDTO",
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "geoLocations"
      +    ],
      +    "title": "FacebookAudienceDTO",
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / body / properties / bidAmount
      Added value: +{
      +  "description": "Bid cap or cost-per-result goal in account currency. Required when the campaign bid strategy is LOWEST_COST_WITH_BID_CAP or COST_CAP.",
      +  "example": 2.5,
      +  "type": "number"
      +}
    • changedInput schema / properties / body / properties / budget / allOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "amount": {
      -        "description": "Budget amount",
      -        "example": 1000,
      -        "type": "number"
      -      },
      -      "budgetType": {
      -        "description": "Budget type",
      -        "enum": [
      -          "DAILY",
      -          "LIFETIME"
      -        ],
      -        "example": "DAILY",
      -        "type": "string"
      -      },
      -      "scheduleEndDate": {
      -        "description": "Schedule end date",
      -        "example": "2024-01-31",
      -        "type": "string"
      -      },
      -      "scheduleStartDate": {
      -        "description": "Schedule start date",
      -        "example": "2024-01-01",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "budgetType",
      -      "amount"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "amount": {
      +        "description": "Ad set budget in account currency",
      +        "example": 100,
      +        "type": "number"
      +      },
      +      "budgetType": {
      +        "description": "Budget type",
      +        "enum": [
      +          "DAILY",
      +          "LIFETIME"
      +        ],
      +        "example": "DAILY",
      +        "type": "string"
      +      },
      +      "scheduleEndDate": {
      +        "description": "Schedule end date",
      +        "example": "2024-01-31",
      +        "type": "string"
      +      },
      +      "scheduleStartDate": {
      +        "description": "Schedule start date",
      +        "example": "2024-01-01",
      +        "type": "string"
      +      }
      +    },
      +    "title": "AdSetBudgetDTO",
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / body / properties / budget / description
      Previous value: -"Ad set budget config"New value: +"Ad set budget config; schedule only under a campaign budget"
    • changedInput schema / properties / body / properties / conversionLocation / description
      Previous value: -"Conversion location"New value: +"Where the conversion happens. Valid values depend on the parent campaign objective — OUTCOME_LEADS: `on_ad` (instant form), `website`, `website_and_lead_form`; OUTCOME_SALES: `website` (pixel), `messaging`. Not validated server-side, so values outside this set are forwarded to Facebook and may be rejected there."
    • changedInput schema / properties / body / properties / customEventType / description
      Previous value: -"Custom event type"New value: +"Facebook standard event optimised for. Only meaningful when `conversionLocation` is `website` (requires `pixelId`). Valid values depend on the parent campaign objective — OUTCOME_LEADS: `COMPLETE_REGISTRATION`, `CONTACT`, `CONTENT_VIEW`, `FIND_LOCATION`, `LEAD`, `SCHEDULE`, `SEARCH`, `START_TRIAL`, `SUBMIT_APPLICATION`, `SUBSCRIBE`; OUTCOME_SALES: `ADD_PAYMENT_INFO`, `ADD_TO_CART`, `ADD_TO_WISHLIST`, `COMPLETE_REGISTRATION`, `CONTENT_VIEW`, `DONATE`, `INITIATED_CHECKOUT`, `PURCHASE`, `SEARCH`, `START_TRIAL`, `SUBSCRIBE`. Not validated server-side, so values outside this set are forwarded to Facebook and may be rejected there."
    • changedInput schema / properties / body / properties / customEventType / example
      Previous value: -"Purchase"New value: +"PURCHASE"
    • addedInput schema / properties / body / title
      Added value: +"UpsertAdsetDTO"
  2. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly=false, destructive=false, idempotent=true, and openWorld=true, so the safety profile is covered. The description adds the write-scope requirement and the underlying PUT endpoint/API version, but says nothing about update-merge behavior or what happens to omitted fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short lines, front-loaded with the action and the create/update distinction. The first line ("Upsert adset") duplicates the title and is slightly redundant with the second line, but nothing else is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Auth scope and endpoint are given, and the rich schema covers inputs, with no output schema needed. Still, for a mutation on a complex nested body, the description does not clarify identification of existing vs new adsets or the effect of partial updates.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% across the deeply nested body, so the schema carries parameter semantics fully. The description adds no field-level meaning beyond what the schema already documents; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (upsert) and resource (Facebook ad set) and clarifies both create and update semantics, which distinguishes it from siblings like ghl_ad_fb_adset_pause, ghl_ad_fb_adset_duplicate, and ghl_ad_fb_adset_delete. It does not explicitly name those siblings, but the resource specificity is strong enough for correct selection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Create or update" implies when to invoke it, and the OAuth scope (adPublishing.write) is useful prerequisite context. However, there is no guidance on when to prefer this over related tools (e.g., campaign/creative upserts that may need to happen first) or any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools