Skip to main content
Glama

Set campaign locations, excluded devices, and ad schedule

set_campaign_targeting

Add positive location targeting, device exclusions, and/or an ad schedule (day-parting) to a campaign. A campaign with no location criteria at all defaults to Google's broadest reach, not 'no targeting' - set this before enabling any campaign meant for specific markets. Device exclusion is a 0 bid modifier on that device's campaign criterion, not a negative criterion - Google Ads has no true negative/exclude on a DEVICE criterion (confirmed live: the API rejects negative: true on one as an immutable field), so a 0 modifier is the real mechanism the Ads UI itself uses for 'excluding' a device on a Search campaign. Google auto-creates one MOBILE/TABLET/DESKTOP criterion per campaign at creation time, so excluding one of those updates its existing criterion; a device with none yet (e.g. CONNECTED_TV) gets one created at modifier 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adScheduleNoDay-parting: one entry per day+hour-range block to serve in, e.g. Mon-Fri 9-18 is 5 entries. A campaign with no ad schedule at all serves every hour of every day.
campaignIdYes
customerIdNo10-digit Google Ads customer id. Omit only if this connection has exactly one reachable account - with more than one, omitting it errors and lists the available ids to pick from.
extraFieldsNoEscape hatch for a field Google requires that this tool doesn't set yet - use it when a prior call to this same tool failed naming a required field and its valid values (e.g. after adding `contains_eu_political_advertising`, retry with { contains_eu_political_advertising: "DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING" }). Keys are the Ads API's own snake_case field names; nest an object to add a field under one this tool already sets (e.g. a new network_settings sub-field). Only ADDS fields not already set by this tool's own arguments - it can never override `status` or any other field already set here, so it cannot be used to bypass validation or a safety default like a campaign's PAUSED-by-default status.
geoTargetIdsNoGeo target constant ids to target, e.g. ['2840','2372'] for US and Ireland. Additive - existing location criteria are left alone.
validateOnlyNoDry run. When true the Google Ads API validates the change and reports any errors but applies nothing. Use this first whenever you are unsure - it is free and cannot affect spend.
excludeDevicesNoDevice types to exclude from serving, e.g. ['MOBILE']. Implemented as a 0 bid modifier - Google Ads has no true device exclusion - which in practice stops that device from serving.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial non-obvious behavior beyond the annotations: device 'exclusion' is actually a 0 bid modifier because the API rejects `negative: true` on DEVICE criteria, and Google auto-creates MOBILE/TABLET/DESKTOP criteria so exclusion updates existing criteria while CONNECTED_TV gets created new. It also clarifies the additive nature of location targeting. No contradiction with destructiveHint=false or idempotentHint=false.

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?

Front-loads the purpose in the first sentence, then spends space on genuinely non-obvious mechanics. It is long and partially duplicates the excludeDevices schema description, which is a minor redundancy, but every sentence carries information an agent would otherwise lack.

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

Completeness4/5

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

For a 7-parameter mutation tool with no output schema and openWorldHint=true, the definition covers defaults, the broadest-reach trap, and the device-criterion mechanism. It does not describe the return payload or confirm what a successful call reports, leaving a modest gap.

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 already 86%, so the baseline is 3; the description goes further by explaining the mechanism behind excludeDevices and clarifying that geoTargetIds is additive to existing criteria. It does not add new meaning for adSchedule or validateOnly 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+resource set: 'Add positive location targeting, device exclusions, and/or an ad schedule (day-parting) to a campaign.' It precisely enumerates the three capability areas and is distinguishable from siblings like update_campaign, get_campaign_criteria, and remove_campaign_criterion.

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?

Gives clear conditional guidance: 'set this before enabling any campaign meant for specific markets,' and warns that omitting location criteria defaults to Google's broadest reach. It does not name alternative tools (e.g., when to prefer update_campaign) or state exclusions, so it stops short of a 5.

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