Skip to main content
Glama

Metadata MCP Connector

Add & Edit Campaign Elements

add_and_edit_campaign_elements
Destructive

Add audiences, ads, offers, or targeting and edit supported settings of a Precision Optimization campaign. Returns the updated configuration and per-operation results or errors. Campaign structure and current platform state constrain which edits are permitted. LinkedIn ads can be added as named Metadata platform ad groups (ads.groups) when the user asks for them. CRITICAL: PARTIAL EDITS ONLY. Only campaignId is required. Supply other fields only for the user's requested changes, never by copying the whole campaign read result. A budget-group-only move uses campaign_data={"campaignId": 12345, "budgetGroup": "Destination"}. Omit name, startDate, endDate and channel blocks unless the user also requested those edits. Campaign-level startDate/endDate writes apply to every channel, including switched-off channels, so replaying a campaign's aggregate dates can overwrite distinct channel dates. On a draft, sending one date keeps the other as saved; when the saved one cannot stay (a start date already passed, an end before the new start, channels saved with different dates) nothing changes and errors says which date to ask the user for. For a budget-only move, read the campaign before and after and verify each channel's startDate/endDate and enabled state are unchanged, alongside the new budget group. The handler returns budget_move_verification for a completed move without date or channel edits. verified=true confirms every channel's identity, dates and switch state and the destination group. verified=false also populates errors: stop further moves and report the changed fields or incomplete readback, even when success=true because the budget group already changed. No schedule rollback is attempted. Do not report dates preserved without that readback; report any mismatch explicitly.

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": {
      "campaign_data": "<campaign_data>"
    },
    "name": "add_and_edit_campaign_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
campaign_dataYesCampaign data with fields to edit and/or elements to add

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / campaign_data / properties / x
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "X (Twitter) elements to add and/or offers to replace. Only a DRAFT campaign's X channel can be edited: a launched X campaign is view-only, and an X block sent for one is refused.",
      +  "properties": {
      +    "ads": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "groups": {
      +          "description": "Named Metadata platform ad groups, ONLY when explicitly requested. Each group needs at least two distinct X ads. Names are capped at 50 characters.",
      +          "items": {
      +            "properties": {
      +              "ads": {
      +                "items": {
      +                  "type": "integer"
      +                },
      +                "type": "array"
      +              },
      +              "name": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "ads"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "list": {
      +          "description": "Array of X ad IDs (from create_update_image_ad with channels=['X']), attached individually. Default unless the user explicitly asks for grouped ads.",
      +          "items": {
      +            "type": "integer"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "audiences": {
      +      "description": "Array of X audience names to ADD (appended to existing): firmographic, technographic, intent, store leads, contact or account CSV uploads, website retargeting contacts, marketing automation lists, HubSpot account lists and dynamic Salesforce lists (the types the platform UI offers for X). Audiences native to another channel (LinkedIn, Facebook, Display, or another channel's retargeting), static Salesforce or G2 Intent lists and Express Firmographic cannot go to X. An audience exists on X only after the platform has uploaded it to a CONNECTED X account, and it blocks the launch until it is READY with at least 100 matched users.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "dailyBudget": {
      +      "description": "Daily budget in USD for this channel (platform minimum $10). Applied through the platform's own channel budget endpoint; without it the channel keeps the platform default of $50/day. Derive from the approved split (e.g. monthly channel budget / 30, rounded to cents).",
      +      "minimum": 10,
      +      "type": "number"
      +    },
      +    "exclude_audiences": {
      +      "description": "Array of X audience names to EXCLUDE (negative targeting) on this channel, appended as channel-level exclusion groups.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "offers": {
      +      "description": "Array of offer IDs. WARNING: REPLACES all existing offers on this channel. MUST contain ONLY Landing Page offer_ids: X has no Lead Gen forms, and the X card clicks through to the landing page (plus UTMs). A Lead Gen offer_id is refused and reported in errors.",
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "target_groups": {
      +      "description": "Array of Targeting Group names for X to ADD (appended to existing): groups built for X in the platform's Targeting Groups section, whose interests, keywords and locations the X launch reads. These are NOT audiences.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / campaign_data / properties / linkedin / properties / ads / properties / groups / description
      Added value: +"Named Metadata platform ad groups for Precision/METADATA campaigns, ONLY when explicitly requested. Each group needs at least two distinct compatible LinkedIn ads of the same type. Names are capped at 50 characters. May be combined with list; preserve native-container routing for NATIVE campaigns."
    • changedInput schema / properties / campaign_data / properties / reddit / properties / ads / properties / list / description
      Previous value: -"Array of Reddit ad IDs, each sent as its own request. Like LinkedIn, Reddit uses list only — no ad groups."New value: +"Array of Reddit ad IDs, attached individually. Reddit uses list only — no ad groups in this tool."
  3. Changed2 schema fields changed
    • changedInput schema / properties / campaign_data / properties / endDate / description
      Previous value: -"Optional new end date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels."New value: +"Optional new end date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels. A draft keeps its saved start date when only endDate is sent."
    • changedInput schema / properties / campaign_data / properties / startDate / description
      Previous value: -"Optional new start date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels."New value: +"Optional new start date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels. A draft keeps its saved end date when only startDate is sent; a launched campaign's start date cannot change."
  4. Changed3 schema fields changed
    • changedInput schema / properties / campaign_data / properties / endDate / description
      Previous value: -"Campaign end date in YYYY-MM-DD format — REPLACES existing end date"New value: +"Optional new end date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels."
    • changedInput schema / properties / campaign_data / properties / startDate / description
      Previous value: -"Campaign start date in YYYY-MM-DD format — REPLACES existing start date"New value: +"Optional new start date (YYYY-MM-DD). Omit unless the user requested a schedule change; supplied dates overwrite that date on every channel, including switched-off channels."
    • changedInput schema / properties / campaign_data / required
      Previous value: -[
      -  "campaignId",
      -  "campaignType",
      -  "name",
      -  "startDate",
      -  "endDate",
      -  "budgetGroup"
      -]New value: +[
      +  "campaignId"
      +]
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare destructive/open-world mutation; the description adds the material context an agent needs: partial-edit discipline, that campaign-level date writes propagate to switched-off channels, that draft date conflicts abort with no rollback, and that budget_move_verification with verified=false must halt further moves even when success=true. That is real behavioral disclosure beyond the structured 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?

Purpose and the CRITICAL partial-edit rule are front-loaded, then date and budget-move behavior follow in order of risk. Some sentences restate schema-level warnings (channel date overwrite) and the readback guidance is repeated in two forms, but the density is largely justified for a destructive multi-channel editor.

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

Completeness5/5

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

With no output schema, the description carries return values itself: updated configuration, per-operation results/errors, and the budget_move_verification shape with verified and errors. Combined with launch-state constraints and the connected/READY audience warning, an agent has what it needs to call and interpret this correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds a concrete minimal payload example (campaign_data={"campaignId": 12345, "budgetGroup": "Destination"}) and an explicit omit-list for name/startDate/endDate/channel blocks that the schema does not state as a rule. It stops short of explaining the channel sub-objects, which the schema handles.

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

Purpose5/5

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

The first sentence gives a specific verb set and resource ('Add audiences, ads, offers, or targeting and edit supported settings of a Precision Optimization campaign') and names what it returns. The scope qualifier 'Precision Optimization campaign' plus the note about Metadata platform ad groups separates it from add_and_edit_native_campaign_elements without requiring the schema.

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

Usage Guidelines4/5

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

Strong when-to guidance: only campaignId is required, other fields only for requested changes, ad groups only when explicitly asked for, and channel settings point elsewhere (update_reddit_channel_settings). It does not explicitly state when to pick the native-structure sibling tool instead, so it stops short of a full when/when-not/alternatives map.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources