Skip to main content
Glama

Metadata MCP Connector

Set Campaign UTMs

set_campaign_utms
Destructive

Set or clear the UTM tracking parameters of ONE channel on a wizard campaign, merging into what the channel already stores.

            KEYWORDS: utm, utms, set utm, change utm, utm_source, utm_medium, utm_campaign, utm_term, utm_content, tracking parameters, campaign override, UPDATE ME

            USE THIS TOOL WHEN THE USER ASKS:
            - "Set utm_source=Linkedin and utm_medium=paid-social on this campaign"
            - "Fix the UPDATE ME placeholder in campaign X's UTMs"
            - "Use utm_campaign=DG_Touch-3 on the LinkedIn channel"

            INHERITANCE RULE - READ BEFORE ANSWERING ANY UTM QUESTION:
            UTMs are inherited, never blank. A campaign channel with an empty stored
            mapping does NOT have "no UTMs" - it tracks with the account's UTM defaults,
            and where the account set nothing it tracks with the Metadata platform default.
            Roughly half of all channel rows in production are in that inherited state.
            NEVER report "no UTMs configured" from an empty stored field: report the
            resolved value and its origin.

            ORIGIN IS PER CHANNEL, not per key: a channel with an empty stored mapping
            inherits the account default whole, so a channel whose resolved mapping differs
            at all from that is stored on the campaign and every one of its values is an
            override. The per-key `same_as_default` flag says whether that one key happens
            to match the default anyway.

            ORIGIN VALUES:
            - campaign_override: stored on this campaign channel, differs from what it would inherit.
            - account_default: inherited from this account's UTM defaults.
            - platform_default: inherited from the Metadata-wide default (account set nothing).
            - not_set: the channel really has no UTM mapping (non-sponsored channels only).

            HONEST LIMIT: a campaign that stores a mapping identical to the default it
            would inherit is reported as inherited. The platform returns resolved values
            with no provenance, so that case cannot be distinguished - say so rather than
            claiming the campaign has no override.

            INPUT:
            - campaign_id: the WIZARD campaign id (from list_wizard_campaigns / search_campaigns_by_names).
            - channel: the enabled channel to edit: LINKEDIN, FACEBOOK, INSTAGRAM, GOOGLE_ADS,
              MICROSOFT_ADS or REDDIT. UTMs are stored per channel; call once per channel.
            - utms: object of UTM key to value. Standard keys UTM_SOURCE, UTM_MEDIUM, UTM_TERM,
              UTM_CAMPAIGN, UTM_CONTENT (utm_source style is accepted and normalised); other keys
              are custom static parameters. A value is either literal text ("paid-social") or one
              of the platform's dynamic tokens, substituted at serve time: AD_CHANNEL, AD_NAME,
              CAMPAIGN_NAME, OFFER_TYPE, OFFER_FORM_NAME, AUDIENCE_NAME_OR_KEYWORD, EXPERIMENT_ID,
              EXPERIMENT_NAME, NATIVE_CHANNEL_CAMPAIGN_ID, NATIVE_CHANNEL_ADGROUP_ID,
              NATIVE_CHANNEL_CREATIVE_ID, NATIVE_CHANNEL_KEYWORD, NATIVE_CHANNEL_SEARCH_TERM.
              Keys you omit keep their current value; an empty string clears a key (the channel
              then inherits that key's default again only if the whole mapping becomes empty).
              `metadata_cid` is reserved and refused.

            HOW IT WRITES: the platform endpoint replaces the campaign's whole UTM map and blanks
            any enabled channel left out of it, so this tool reads the current mappings first and
            re-sends every other enabled channel unchanged. A channel that was inheriting the
            account default is re-sent with the same values it already resolves to, so tracking
            does not change for it.

            A Draft campaign carries the result into launch. On a launched campaign the mapping is
            stored and reaches the ad platform with the next campaign publish (Microsoft Ads is
            pushed live immediately). Verify with get_campaign_utms.

            RESPONSE SHAPE:
            {"success": true, "campaign_id": 173290, "channel": "LINKEDIN",
              "applied": {"set": {"UTM_SOURCE": "Linkedin"}, "cleared": []},
              "stored_mapping": {...}, "resolved": {...same shape as get_campaign_utms.channels.LINKEDIN...},
              "notes": ["..."]}

            Account-level UTM defaults are NOT edited here (get_account_utm_defaults is read-only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
utmsYesUTM key to value, e.g. {"UTM_SOURCE": "Linkedin", "UTM_MEDIUM": "paid-social", "UTM_CAMPAIGN": "DG_Touch-3_TAG", "UTM_CONTENT": "AD_NAME"}. Empty string clears a key.
channelYesThe enabled channel whose UTM mapping to edit.
campaign_idYesWizard campaign id (the `id` from list_wizard_campaigns).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, and the description adds substantial behavioral context: it discloses that the endpoint replaces the whole UTM map and blanks omitted channels, but that the tool mitigates this by reading and re-sending other channels. It explains inheritance (empty stored mapping ≠ no UTMs, resolves to account/platform default), origin values (campaign_override, account_default, platform_default, not_set), and the honest limit about identical mappings being reported as inherited. It also describes the response shape and verification step. This goes far beyond the annotation flags.

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

Conciseness5/5

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

The description is long but meticulously structured with clear sections (KEYWORDS, USE THIS TOOL, INHERITANCE RULE, ORIGIN VALUES, INPUT, HOW IT WRITES, RESPONSE SHAPE). Core purpose is front-loaded; every section earns its place by addressing a distinct operational concern (selection, inheritance semantics, write behavior, response). It reads like a well-organized reference rather than a wall of text.

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?

No output schema is provided, but the description gives an explicit RESPONSE SHAPE example with fields and a pointer to get_campaign_utms for verification. It covers inheritance rules, origin values, the honest limit, per-channel behavior, and draft vs launched timing. For a complex mutation tool with no output schema, nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds critical meaning: it enumerates valid UTM keys, explains dynamic tokens (AD_CHANNEL, CAMPAIGN_NAME, etc.), clarifies that empty string clears a key and inheritance behavior, reserves metadata_cid, and explains the merging semantics (omitted keys keep current value). It also clarifies the 'channel' enum and that campaign_id comes from list_wizard_campaigns. The description transforms the schema from flat field names into a rich operational contract.

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?

Description states a clear verb+resource: 'Set or clear the UTM tracking parameters of ONE channel on a wizard campaign, merging into what the channel already stores.' It differentiates from siblings (get_campaign_utms is read, get_account_utm_defaults is read-only) and includes an explicit 'USE THIS TOOL WHEN THE USER ASKS' section with concrete examples. The scope (one channel) is front-loaded and unambiguous.

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

Usage Guidelines5/5

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

Provides explicit when-to-use examples ('Set utm_source=Linkedin...', 'Fix the UPDATE ME placeholder...'), names alternatives (get_campaign_utms for reading, get_account_utm_defaults for account defaults), and explicitly states 'Account-level UTM defaults are NOT edited here'. It also explains the write behavior (reads current mappings, re-sends other channels) and when changes take effect (draft vs launched). No ambiguity about selection or prerequisites.

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