Skip to main content
Glama

Spend by audience and placement

get_audience_breakdown
Read-onlyIdempotent

One ad platform's spend and results split by who saw the ads or where: Meta by age, gender, device, placement or platform; Google by device, age, gender or platform (network). Per row: spend, share (of the split's spend, 0..1), impressions, clicks, conversions, conversionValue, roas and cpa — all as the PLATFORM reports them, so say so. byCampaign repeats the split per campaign; campaigns lists the campaigns with breakdown data (id + name): pass campaignId to read one. coverage = the share of the platform's campaign spend these rows explain (below 1 mostly because Google gives age and gender for Search and Shopping only, never Performance Max). unconverted true = some rows are in a currency with no rate yet and are left out. Null conversions = the platform reported none for that segment, not zero. Optional from and to (inclusive YYYY-MM-DD, both or neither, never after today) read another span instead of the default period. A named month, a week or two dates the operator gave MUST be sent here: without them this reads the default period (the one on the operator's screen, else the last 30 days), which is not that month. When the operator names no period, send neither.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>",
      "dimension": "<dimension>"
    },
    "name": "get_audience_breakdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.
fromNoFirst day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.
sourceYesThe ad platform: meta or google.
dimensionYesHow to split the spend. Meta: age, gender, device, placement or platform (Facebook, Instagram, Audience Network, Messenger). Google: device, age, gender or platform (network). none = one row per campaign, no split.
campaignIdNoOne campaign's id, from a first call's campaigns list; omit for every campaign.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / dimension / enum
      Previous value: -[
      -  "age",
      -  "gender",
      -  "device",
      -  "placement",
      -  "platform",
      -  "region",
      -  "hour",
      -  "none",
      -  "weekday"
      -]New value: +[
      +  "age",
      +  "gender",
      +  "device",
      +  "placement",
      +  "platform",
      +  "region",
      +  "hour",
      +  "country",
      +  "none",
      +  "weekday"
      +]
  2. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period."New value: +"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
    • changedInput schema / properties / to / description
      Previous value: -"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period."New value: +"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
  3. Changed1 schema field changed
    • changedInput schema / properties / dimension / enum
      Previous value: -[
      -  "age",
      -  "gender",
      -  "device",
      -  "placement",
      -  "platform",
      -  "none"
      -]New value: +[
      +  "age",
      +  "gender",
      +  "device",
      +  "placement",
      +  "platform",
      +  "region",
      +  "hour",
      +  "none",
      +  "weekday"
      +]
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds substantial behavior beyond them: values are platform-reported, coverage explains what fraction of spend the rows account for and why Google under-reports (Search/Shopping only, never Performance Max), unconverted=true means rows in an unrated currency were excluded, and null conversions mean "not reported" rather than zero. These are exactly the caveats an agent needs to avoid misreporting numbers.

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 and dimension vocabulary before the caveats, and nearly every clause carries information. It is a dense semicolon-chained block with the output-field glossary mixed into the same paragraph as the usage rules, which makes it harder to scan than it needs to be.

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?

There is no output schema, so the description must carry the return contract, and it does: spend, share (0..1, relative to the split's spend), impressions, clicks, conversions, conversionValue, roas, cpa, plus coverage, byCampaign and campaigns. Combined with the period and currency caveats, an agent has everything needed to call it and interpret the result correctly.

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 100%, so the baseline is 3, but the description adds meaning: campaignId is sourced from a prior call's campaigns list, from/to must be sent as a pair and never after today, and the default-period fallback chain (operator's screen period, else last 30 days) is spelled out. Some of this duplicates the schema's own parameter text, which 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 specific verb and resource ("one ad platform's spend and results split by who saw the ads or where") and then enumerates the exact dimension vocabulary per platform (Meta: age/gender/device/placement/platform; Google: device/age/gender/platform). That platform-to-dimension mapping is something no sibling name or schema alone conveys.

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 explicit, actionable conditions: named month/week/two dates MUST be sent as from/to, and when no period is named send neither. It also explains the campaignId workflow (read the campaigns list first, then pass an id). It stops short of naming when to prefer a sibling tool such as get_campaigns, so it is clear context without explicit alternatives.

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