Skip to main content
Glama

Set segment costs

set_segment_costs
Destructive

Book a known spend onto a traffic SEGMENT — period + any analytics filters, across campaigns ("I spent $500 on offer 3 / zone 1234 last week, lay it out"). 'set' makes the segment's total cost exactly amount (other clicks in the segment zeroed), 'add' puts it on top. 'even' spreads per click; 'proportional' scales each click's current cost so an ad-network sync's shape survives and only the total moves. Bots never carry cost unless include_bots; unique_only restricts carriers to unique clicks; landing-exit clicks never carry cost. Applied asynchronously (result 'queued'), 90-day editable window. Works like per-campaign cost booking, for arbitrary segments.

Input Schema

NameRequiredDescriptionDefault
osNo
ispNo
cityNo
modeNo'set' (default) makes the segment total exactly `amount`; 'add' increments it
siteNoPlacement / zone id as passed by the ad network
sub1NoFilter by sub1
sub2NoFilter by sub2
sub3NoFilter by sub3
sub4NoFilter by sub4
sub5NoFilter by sub5
sub6NoFilter by sub6
sub7NoFilter by sub7
sub8NoFilter by sub8
sub9NoFilter by sub9
userNoWorkspace member id(s), comma-separated — the campaign owner at click time (needs the "See statistics per team member" permission; ignored otherwise)
offerNoOffer id
sub10NoFilter by sub10
sub11NoFilter by sub11
sub12NoFilter by sub12
sub13NoFilter by sub13
sub14NoFilter by sub14
sub15NoFilter by sub15
amountYesUSD
deviceNomobile / tablet / desktop
periodNoReporting period (default 7days). Use 'custom' with date_from/date_to.
sourceNoTraffic source id
browserNo
countryNoCountry ISO alpha-2 code, e.g. ES
date_toNoYYYY-MM-DD (with period=custom)
landingNoLanding id
campaignNoCampaign ALIAS(es), comma-separated for several
creativeNoCreative id from the click URL
languageNo
pwa_tagsNoComma-separated tag ids — pwas carrying any of them
referrerNo
utm_termNoExact utm_term value from the click URL
date_fromNoYYYY-MM-DD (with period=custom)
pwa_groupNoPwa group id
smartlinkNoSmartlink id
source_idNoSource id as passed by the ad network
offer_tagsNoComma-separated tag ids — offers carrying any of them
utm_mediumNoExact utm_medium value from the click URL
utm_sourceNoExact utm_source value from the click URL
ad_campaignNoThe ad network's own campaign id (external_campaign_id)
aff_networkNoAffiliate network id
offer_groupNoOffer group id
source_tagsNoComma-separated tag ids — sources carrying any of them
unique_onlyNoOnly unique clicks carry cost; repeat visits in the segment are zeroed by a set
utm_contentNoExact utm_content value from the click URL
distributionNo'even' (default) per click; 'proportional' to each click's current cost
include_botsNoLet bot clicks carry cost too (default false — networks never bill crawlers)
landing_tagsNoComma-separated tag ids — landings carrying any of them
source_groupNoSource group id
utm_campaignNoExact utm_campaign value from the click URL
campaign_tagsNoComma-separated tag ids — campaigns carrying any of them
landing_groupNoLanding group id
campaign_groupNoCampaign group id
smartlink_tagsNoComma-separated tag ids — smartlinks carrying any of them
connection_typeNo
smartlink_groupNoSmartlink group id

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag it as destructive and non-idempotent; the description adds genuinely useful behavior beyond them: 'set' zeroes other clicks in the segment, execution is asynchronous with a 'queued' result, and there is a 90-day editable window. It also discloses hidden carrier rules (bots skipped unless include_bots, landing-exit clicks never carry cost). It does not mention required permissions or permanence of the overwrite, so it stops short of a 5.

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?

Dense single paragraph with the core action front-loaded and mode/distribution semantics grouped in the middle. Every clause carries information, though the parenthetical-heavy style and the parenthetical example make it slower to parse than it needs to be.

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 60-parameter mutation tool with no output schema, the definition covers the essentials an agent needs: mode semantics, distribution behavior, async 'queued' result, and the 90-day window. It omits permission requirements and how to confirm completion, but nothing critical to correct invocation is missing.

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 88%, so the schema carries most of the load, but the description still adds meaning the schema lacks: why 'proportional' exists ('so an ad-network sync's shape survives and only the total moves') and the interaction of unique_only/include_bots with cost carriers. The 60 filter parameters are not described, which is reasonable but keeps it from a 5.

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 concrete verb and resource ('book a known spend onto a traffic SEGMENT — period + analytics filters') and disambiguates from the nearest sibling by noting it 'works like per-campaign cost booking, for arbitrary segments', implicitly contrasting with set_campaign_costs. An agent can identify the operation without opening 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?

The example ('I spent $500 on offer 3 / zone 1234 last week, lay it out') gives a clear triggering scenario, and the closing sentence contrasts it with per-campaign cost booking. However, it never explicitly routes to or away from siblings like preview_segment_costs, set_campaign_costs, or import_meta_costs, so the alternative-selection step is left implied.

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