Skip to main content
Glama

Ad spend and ROAS (all networks)

get_ad_spend
Read-onlyIdempotent

Ad spend, impressions and clicks per campaign, ad group or ad for every connected ad network (Meta Ads, Google Ads), next to the ad visitors, customers, first-touch revenue and assisted revenue each brought, with ROAS and cost per customer. provider=all (default) adds combined totals across networks; accounts[] has each network's totals; several ad accounts per network are combined (adAccounts[] lists them, account= reports one alone). Meta and Google rows and per-network totals (accounts[].totals) also carry reportedValue/reportedPurchases/reportedRoas: what that network itself reports (Meta: purchase value and purchases; Google: metrics.conversions_value and conversions), converted into the report currency, for comparison only (never in revenue or ROAS); combined totals carry them only when one such network is in the report. Visits with only a click ID (fbclid, gclid) are reported in unattributed and never counted in totals or ROAS. Spend is converted into the report currency.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_ad_spend"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day, YYYY-MM-DD (inclusive).
fromNoFirst day, YYYY-MM-DD (inclusive). Use with to.
levelNoRow level (default campaign). adgroup is Meta's ad set.
fieldsNoOptional: only these parts of the answer, as comma-separated dot paths (e.g. overview.current,series.date,series.visitors). Through a list a path applies to every item; period is always kept. An unknown top-level name fails with the list of valid ones. Leave out for the full answer.
periodNoPreset period, default 30d. today/yesterday/wtd/mtd follow the timezone. Ignored when from and to are set.
accountNoOne ad account ID (from adAccounts[]): that account alone instead of every chosen account combined.
compareNoWhat change figures compare against: previous (default, the equal-length window right before), weekdays (the same length, starting whole weeks earlier on the same weekday, so Mondays compare with Mondays), year (same period last year), or a YYYY-MM-DD start (window keeps the period's length). Ignored for period all.
campaignNoA campaign ID: adds that campaign day by day with its customers.
providerNoAd network (default all connected, combined).
timezoneNoIANA time zone for day boundaries and grouping, e.g. Europe/Madrid. Default UTC.
website_idNoWebsite ID from list_websites (the data-site-id value in the tracking script).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Annotations already declare a safe read-only, idempotent operation, yet the description adds substantial semantics an agent could not otherwise know: reportedValue/reportedPurchases/reportedRoas are network-reported figures used for comparison only and never enter revenue or ROAS, click-ID-only visits go to unattributed and never count in totals, and spend is converted into the report currency. These caveats directly prevent misinterpretation of the output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded, but the remainder is a single dense block with heavy parenthetical nesting (Meta/Google metric names, currency notes, unattributed caveats). Almost every sentence carries useful information, yet the lack of separation makes the reportedValue and unattributed rules easy to skim past.

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 an 11-parameter report tool with no output schema, the description covers the important ambiguities: multi-account aggregation, network-reported metric provenance, unattributed traffic, and currency conversion. It does not describe the overall response structure (e.g. overview/series/totals layout referenced by the fields parameter), which leaves a small gap for an agent parsing results.

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 would be 3, but the description adds real meaning about how provider and account interact: provider=all merges networks, accounts[] holds per-network totals, adAccounts[] lists individual accounts, and account= isolates one, with multiple accounts per network combined. That interaction is not obvious from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb-like resource statement: ad spend, impressions and clicks per campaign/ad group/ad for every connected ad network, paired with visitors, customers, revenue and ROAS. The scope (all networks, combined totals) is unmistakable. It stops short of naming a sibling such as get_meta_ads as the narrower alternative, so it is clear but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied through parameter behavior — provider=all adds combined totals, account= reports one account alone, several accounts per network are merged. There is no explicit 'use this when' or 'use X instead' guidance, and no prerequisites or exclusions stated. An agent can infer the tool's purpose but gets no selection guidance against 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