Skip to main content
Glama

Get campaign spend

get_campaign_spend
Read-onlyIdempotent

Paid ads per campaign, or per ad with grain=ad, for a site over a date window (default last 30 days, at most 90). Each row has what the platform reports (spend, impressions, clicks, platform conversions) next to what Anry attributed on the site (revenue, conversions, sessions, ROAS), in the site's currency, ordered by spend. Use to connect ad investment with on-site outcome, find which ads or campaigns return revenue, and spot spend with no attributed visit. Narrow with platform or campaign_id when the result is truncated.

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": {
      "site_id": "<site_id>"
    },
    "name": "get_campaign_spend"
  }
}

Input Schema

NameRequiredDescriptionDefault
grainNoRow level (default campaign)
limitNoMax rows to return (default 50)
site_idYesSite id from list_sites (UUID)
end_dateNoISO date (YYYY-MM-DD). Defaults to today.
platformNoOnly this ad platform
start_dateNoISO date (YYYY-MM-DD). Defaults to 30 days before end_date.
campaign_idNoOnly this campaign (a campaign_id from a campaign row)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive behavior, so the safety profile is covered. The description adds real context beyond them: the default 30-day window with a 90-day ceiling, ordering by spend, results in the site's currency, and the side-by-side platform-reported vs. Anry-attributed row structure. It does not say whether an over-90-day range errors or is clamped, which keeps it from 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.

Conciseness5/5

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

Three sentences, front-loaded with the resource definition, then purpose, then narrowing advice. The dense first sentence is information-bearing (grain, entity, window, row contents, ordering, currency) rather than padding; nothing reads as filler.

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?

With no output schema, the description carries the burden of describing return values and does so: row composition, units (site currency), and ordering. For a 7-parameter read tool with full schema coverage and clear annotations, an agent has everything needed to call it correctly and interpret the result.

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%, so the baseline would be 3, but the description adds meaning the schema does not contain: the 90-day maximum window (the schema only documents the 30-day default), what grain=ad changes about the row level, and that platform/campaign_id are the narrowing levers when the row cap is hit. This is genuine semantic value above 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?

The opening sentence names a specific resource (paid ads per campaign or per ad), the grain switch, the scoping entity (a site), and the date window. An agent can immediately tell this apart from siblings like get_paid_waste_summary or get_analytics_overview because the row-level paid-ads-plus-attribution framing is explicit.

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?

It gives concrete use cases: connecting ad investment to on-site outcome, finding which ads/campaigns return revenue, and spotting spend with no attributed visit. It also instructs narrowing with platform or campaign_id when results are truncated. It stops short of naming an alternative sibling tool for overlapping questions (e.g., the paid-waste summary), so no explicit exclusions.

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