Skip to main content
Glama

Metadata MCP Connector

Set Geo Targeting on a Search Channel

set_search_channel_locations
Destructive

Set the geographic targeting of a wizard campaign's search channel (Google Ads or Microsoft Ads) — which countries/states the campaign serves in, and which countries to exclude.

            Matches the platform UI's "Location" picker under the Google Ads / Microsoft Ads channel SETTINGS panel, plus the "Negative Locations" editor under that channel's Advanced Settings.

            WARNING: NEW SEARCH CAMPAIGNS DEFAULT TO UNITED STATES. The platform seeds the Location
            field with United States, so a campaign created without calling this tool serves in
            the US only. Whenever the user names a geography — "target Canada and the UK",
            "run this in EMEA", "exclude India" — set it explicitly; do not assume the default
            is what they want.

            KEYWORDS: geo, geos, geo targeting, geotargeting, geographic, geography, location,
            locations, location targeting, country, countries, state, states, region, territory,
            market, target location, exclude location, exclude geo, exclude country,
            negative location, negative locations, location exclusion, excluded locations,
            where the campaign runs, google ads, google, microsoft ads, microsoft, bing,
            search channel, search campaign, campaign settings

            WHEN TO USE:
            - Point a search campaign at specific countries/states instead of the US default
            - Exclude countries the campaign must not serve in
            - Clear targeting back to all locations (countries=[], states=[])

            REQUIREMENTS:
            - The campaign MUST already have the target channel enabled (via create_campaign /
              add_and_edit_campaign_elements with a `google` and/or `microsoft` block).
            - Geo targeting here is search-channel-only. LinkedIn / Meta / Reddit carry location
              on the audience or target group instead — use create_target_group or the audience
              tools for those.

            PARAMETERS (each one REPLACES that side of the targeting; omit to leave untouched):
            - campaign_id (required): the wizard campaign ID.
            - channel (required): "GOOGLE_ADS" or "MICROSOFT_ADS".
            - countries: country NAMES to target, e.g. ["United States", "Canada"].
              Pass [] to clear (= all locations).
            - states: US state NAMES to target, e.g. ["Texas", "California"].
              Pass [] to clear. States are US-only.
            - excluded_countries: country NAMES the campaign must NOT serve in.
              Pass [] to clear all exclusions.

            Names are matched case-insensitively against the platform's location catalog and
            common shorthand resolves ("USA", "UK", "UAE"). An unrecognised name is REJECTED
            rather than skipped — a silently dropped geo would serve the campaign somewhere
            nobody chose. At least one of the three lists must be given.

            WARNING: EXCLUSIONS ARE COUNTRY-LEVEL ONLY. The platform stores exclusions as bare
            location ids with no country/state discriminator, and state ids overlap country ids,
            so an excluded state would be read back as an unrelated country. The UI's Negative
            Locations picker is countries-only for the same reason. To narrow within a country,
            target the states you want via `states` instead of excluding the ones you don't.

            EXAMPLES:

            Target Canada and the UK on Google Ads (replacing the US default):
            set_search_channel_locations({
                "campaign_id": 177214,
                "channel": "GOOGLE_ADS",
                "countries": ["Canada", "United Kingdom"]
            })

            Target three US states only:
            set_search_channel_locations({
                "campaign_id": 177214,
                "channel": "GOOGLE_ADS",
                "countries": ["United States"],
                "states": ["Texas", "California", "New York"]
            })

            Keep targeting as-is but exclude two countries on Microsoft Ads:
            set_search_channel_locations({
                "campaign_id": 177214,
                "channel": "MICROSOFT_ADS",
                "excluded_countries": ["India", "Pakistan"]
            })

            RESPONSE: {success, campaign_id, channel_id, channel, applied:{locations?:{countries,states}, excluded_locations?:{countries}}, errors?}
            `applied` echoes the resolved location NAMES, so you can confirm back to the user what the campaign now targets.

            INTEGRATION WITH OTHER TOOLS:
            - Use search_campaigns_by_names / get_campaign_by_wizard_id to find the campaign.
            - create_campaign and add_and_edit_campaign_elements accept the same geo inline on
              their `google` / `microsoft` blocks — prefer that when creating, and use this tool
              to change geo on a campaign that already exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statesNoUS state NAMES to target, e.g. ["Texas", "California"]. REPLACES the channel's current states. Pass [] to clear. Omit to leave unchanged. US states only.
channelYesWhich search channel on the campaign to update. Geo targeting is set per channel and only these two carry it.
countriesNoCountry NAMES to target, e.g. ["United States", "Canada"]. REPLACES the channel's current countries. Pass [] to clear (targets all locations). Omit to leave unchanged.
campaign_idYesThe unique identifier of the wizard campaign.
excluded_countriesNoCountry NAMES the campaign must NOT serve in, e.g. ["India"]. REPLACES the channel's current exclusions. Pass [] to clear them all. Omit to leave unchanged. Country-level only — states cannot be excluded.

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 indicate write (readOnlyHint=false) and destructive (destructiveHint=true), but the description goes further: warns about the US default, replacement semantics (each list replaces), country-level-only exclusions with id overlap issue, and rejection of unrecognized names. Adds substantial behavioral context beyond annotations.

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?

Long but every section earns its place: core purpose front-loaded, then warnings, parameters, examples, response format, integration. Headers and bullet points aid scanning. No fluff; all content is actionable for the agent.

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?

For a 5-parameter mutation tool with no output schema, the description is complete: it specifies requirements (channel enabled), parameter semantics, validation behavior, response structure, examples, and integration with other tools. 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?

Schema coverage is 100%, but the description adds rich semantics: explains replacement vs omit behavior, how [] clears, case-insensitive matching with shorthand resolution, rejection of unknown names, and the 'at least one list required' constraint. Examples illustrate parameter usage clearly. Far exceeds baseline.

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, resource, and scope: 'Set the geographic targeting of a wizard campaign's search channel (Google Ads or Microsoft Ads) — which countries/states the campaign serves in, and which countries to exclude.' Clearly distinguishes from sibling tools like create_target_group for other channels.

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?

Explicit 'WHEN TO USE' section lists concrete scenarios, and 'INTEGRATION WITH OTHER TOOLS' clarifies when to use inline geo on create_campaign vs this tool. Also states it's search-channel-only and routes LinkedIn/Meta/Reddit to other tools. No ambiguity left.

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