Skip to main content
Glama
google-ad-manager-mcp

google-ad-manager-mcp

by Jakob-Peters

gam_run_report

Read-onlyIdempotent

Run Google Ad Manager Interactive Reports to fetch delivery, revenue, fill-rate, and ad-speed rows for performance analysis, using server-side filters to narrow results.

Instructions

MODE: read-only compute. UI: Reporting → Interactive reports. (creates a HIDDEN, API-only report definition, reused across identical runs; invisible in the UI, no entity changes.) Run a Google Ad Manager Interactive Report and return the rows. Either pick a preset ('ad_unit_totals' = Ad unit × totals: total impressions + total (CPM/CPC/CPD) revenue per ad unit for the date range; 'delivery_detail' = Advertiser × order × line item × date (with ids): impressions, revenue, eCPM, clicks, CTR, viewability rate; 'ad_speed' = AD SPEED: date × ad unit (levels 2-3) with tag-load→first-ad-request and DOM-load→tag-load latency buckets; 'ad_unit_fill_rate' = Ad unit (full hierarchy path) × date: fill rate + ad requests) or supply explicit dimensions + metrics — exact enum names from gam_report_metadata (max 10 dimensions). Date range: date_range_relative (enum from gam_report_metadata kind=date_ranges, e.g. YESTERDAY, LAST_30_DAYS) OR start_date+end_date. Money metrics are returned in currency units (converted from micros exactly once; see valueNotes). Self-heals dimension/metric incompatibility by retrying with expanded compatibility. Reports run asynchronously — expect seconds to a couple of minutes. KEY-VALUES / CUSTOM FIELDS: dimensions like CUSTOM_DIMENSION__VALUE need their key id passed in the matching array — custom_dimension_key_ids, line_item_custom_field_ids, order_custom_field_ids, creative_custom_field_ids, cms_metadata_key_ids, ekv_dimension_key_ids — at index N. gam_report_metadata names which array and slot each dimension reads; gam_targeting_keys gives the id. FILTERS: where narrows by DIMENSION value and is applied BY GAM, server-side — use it to make a report small (e.g. where=[{dimension:"ORDER_ID",values:["1234567890"]}] took 5,152 rows to 2). having narrows by METRIC value but is applied CLIENT-SIDE to the rows fetched, because GAM accepts metric filters and then ignores them — so a having result is only complete when every row was fetched; the response reports havingScannedRows/havingMatchedRows and flags havingIncomplete when it was not. Narrow with where first, then use having. Clauses AND together; match_any=true ORs the where clauses. WHEN TO USE: any 'how did X perform' question against the ad server. Filter rather than pulling thousands of rows and aggregating client-side.

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": "gam_run_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
whereNoDimension filters — which rows exist. ANDed unless match_any.
havingNoMetric filters — which rows are interesting. ANDed unless match_any.
presetNoNamed preset (overridable by dimensions/metrics).
metricsNoExact Metric enum names (gam_report_metadata).
end_dateNoFixed range end, YYYY-MM-DD, inclusive.
max_rowsNoRow cap (default 200). totalRowCount always reported.
match_anyNoOR the filter clauses instead of ANDing them (default false).
dimensionsNoExact Dimension enum names (gam_report_metadata).
start_dateNoFixed range start, YYYY-MM-DD (with end_date).
report_typeNoReport type. Default HISTORICAL (delivery/revenue). AD_SPEED = page/creative latency. Each type has its OWN compatible dimensions and metrics — a HISTORICAL metric in an AD_SPEED report is rejected.
network_codeNo
currency_codeNoOverride the report currency (default: network currency).
timeout_secondsNoPoll timeout (default 180s).
date_range_relativeNoRelative date range enum, e.g. YESTERDAY, LAST_7_DAYS, LAST_MONTH.
cms_metadata_key_idsNoIds backing CMS_METADATA_DIMENSION_<N>_* dimensions, by index.
ekv_dimension_key_idsNoIds backing EKV_DIMENSION_<N>_* dimensions, by index.
order_custom_field_idsNoIds backing ORDER_CUSTOM_FIELD_<N>_* dimensions, by index.
custom_dimension_key_idsNoKEY-VALUE REPORTING: custom targeting key ids backing CUSTOM_DIMENSION_<N>_VALUE / _VALUE_ID. Index N of this array is the key that dimension reads. Keys must have reportableType CUSTOM_DIMENSION (gam_targeting_keys). For ordinary key-value reporting the KEY_VALUES_NAME dimension needs no ids.
creative_custom_field_idsNoIds backing CREATIVE_CUSTOM_FIELD_<N>_* dimensions, by index.
line_item_custom_field_idsNoIds backing LINE_ITEM_CUSTOM_FIELD_<N>_* dimensions, by index.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say readOnly/idempotent/non-destructive; the description adds that a hidden API-only report definition is created but no entities change, that runs are asynchronous and take seconds to minutes, and that the tool self-heals dimension/metric incompatibility by retrying. It also discloses the critical asymmetry that `where` is applied server-side by GAM while `having` is applied client-side with havingIncomplete/havingScannedRows flags when rows were truncated.

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-loaded with MODE/UI disclosure, then presets, then date handling, then a caps-labeled KEY-VALUES and FILTERS section, then WHEN TO USE. The prose is dense and long, with a few sentences that restate schema detail (e.g. the enum date-range examples), but the structure keeps it navigable.

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?

For a 20-parameter, no-output-schema tool this covers the gaps that matter: async timing, the 200-row default and 10,000 cap with totalRowCount always reported, exact currency conversion from micros, and the incompleteness signaling on `having`. Nothing an agent needs in order to call it correctly appears to be 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 already 95%, so the baseline is 3; the description still adds meaning beyond it by explaining the preset definitions, the server-side vs client-side split between `where` and `having`, and the index-N contract linking CUSTOM_DIMENSION_<N>_VALUE to custom_dimension_key_ids. It restates some schema content (date range alternatives, max dimensions) but the cross-parameter relationships are genuinely new.

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: run a Google Ad Manager Interactive Report and return the rows, with the four named presets spelled out dimension-by-dimension. It is clearly distinguishable from gam_report_metadata (which it defers to for enum names) and gam_targeting_keys (source of key ids).

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

Usage Guidelines5/5

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

Explicit 'WHEN TO USE: any how did X perform question against the ad server,' plus the routing rule 'filter rather than pulling thousands of rows and aggregating client-side.' It also directs the agent to gam_report_metadata for enum names and gam_targeting_keys for key ids before calling, which is concrete alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.