Skip to main content
Glama

Metadata MCP Connector

Remove Keywords from Campaign

remove_keywords_from_campaign
Destructive

Remove Google Ads keyword groups and/or negative keyword list attachments from a campaign's GOOGLE_ADS channel.

            Use this tool to clear keywords/negative lists from a DRAFT campaign so the
            user can replace them with new ones (e.g. "I don't like these keywords, use
            these instead" — call this tool to remove the old set, then call
            add_and_edit_campaign_elements with the new google.keywords / google.negative_keyword_lists).

            Works on both campaign structures. On a Channel-First / Native (N×N×N) campaign a
            positive keyword group is also unlinked from its WizNativeAdContainer (keywordGroupId);
            negative-list detach is channel-level and unchanged.

            KEYWORDS: remove, delete, keyword, keywords, negative, group, google, campaign

            PLATFORM CONSTRAINT:
            - Only the Draft state allows keyword removal; the platform rejects DELETE on launched/launching campaigns.

            CHANNEL: GOOGLE_ADS only (other channels do not have keyword groups).

            RESPONSE:
            - Returns the refreshed campaign state plus a removal_results list with one
              {channel, keyword_group|negative_keyword_list, success, message|error} entry per
              requested removal. ALWAYS check removal_results — a partial failure (e.g. one of
              two group names not found) still returns normally.
            - If EVERY requested removal failed, the tool errors instead of returning.

            REQUIRED:
            - campaign_id: Campaign ID (numeric identifier)
            - At least one of channel_keywords OR channel_negative_keyword_lists must be provided.

            OPTIONAL FAST PATH:
            - channel_id: When you already have the GOOGLE_ADS channel id in context (e.g. from a recent get_campaign_by_wizard_id call), pass it to skip the full-campaign lookup. The tool will fetch only that single channel.

            EXAMPLES:

            Remove one keyword group:
            remove_keywords_from_campaign({
                "campaign_id": 42546,
                "channel_keywords": {
                    "GOOGLE_ADS": ["CRM Keywords"]
                }
            })

            Remove a negative keyword list attachment:
            remove_keywords_from_campaign({
                "campaign_id": 42546,
                "channel_negative_keyword_lists": {
                    "GOOGLE_ADS": ["Competitor Brands"]
                }
            })

            Remove both at once:
            remove_keywords_from_campaign({
                "campaign_id": 42546,
                "channel_keywords": {"GOOGLE_ADS": ["CRM Keywords", "Demo Keywords"]},
                "channel_negative_keyword_lists": {"GOOGLE_ADS": ["Competitor Brands"]}
            })

            Remove with known channel id (skips campaign lookup):
            remove_keywords_from_campaign({
                "campaign_id": 42546,
                "channel_id": 88123,
                "channel_keywords": {"GOOGLE_ADS": ["CRM Keywords"]}
            })

            INTEGRATION WITH OTHER TOOLS:
            - Use get_campaign_by_wizard_id to inspect current keyword groups on a channel before removing.
            - After removal, use add_and_edit_campaign_elements with google.keywords / google.negative_keyword_lists to add replacements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idNoOptional fast-path: numeric id of the GOOGLE_ADS channel on this campaign. When provided, the tool skips the full-campaign GET and fetches only this channel's keyword list. Use it when you already have the id from a recent campaign read; omit it and the tool resolves the channel by type.
campaign_idYesThe unique identifier of the campaign
channel_keywordsNoMap of channel type to list of positive keyword group names to remove. Only GOOGLE_ADS is supported. Example: {"GOOGLE_ADS": ["CRM Keywords"]}
channel_negative_keyword_listsNoMap of channel type to list of negative keyword list names to detach from the channel. Only GOOGLE_ADS is supported. Example: {"GOOGLE_ADS": ["Competitor Brands"]}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the destructiveHint annotation by disclosing partial-failure behavior via removal_results, the error condition when every removal fails, the Draft-state platform rejection, and the Channel-First/Native campaign structure nuance. These are exactly the behavioral details an agent needs before invoking a destructive tool.

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?

The description is long but well-structured with clear sections, a front-loaded summary, and concrete examples. The KEYWORDS line adds little for an agent, and the length is substantial, but the substantive sections each earn their place for a destructive, multi-behavior tool.

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 fully covers the response shape (refreshed campaign state plus removal_results entries), partial and total failure semantics, required parameters, optional fast path, platform constraints, and integration with related tools. Nothing needed to invoke 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?

Even though schema coverage is 100%, the description adds the critical at-least-one-of constraint between channel_keywords and channel_negative_keyword_lists, explains the channel_id fast-path semantics, and provides complete JSON examples for each parameter combination. This is meaningful added value beyond the schema.

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?

States a specific verb and resource: 'Remove Google Ads keyword groups and/or negative keyword list attachments from a campaign's GOOGLE_ADS channel.' This clearly differentiates from siblings like remove_keywords_from_negative_list, which operates on a negative list itself rather than on a campaign's channel.

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?

Provides an explicit use case ('clear keywords/negative lists from a DRAFT campaign so the user can replace them') and clear constraints (Draft state only, GOOGLE_ADS only). It also names companion tools for inspection and replacement. It does not explicitly call out sibling alternatives to avoid, but the usage context is strong.

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