Skip to main content
Glama

Query advertising campaigns

query_advertising_campaigns
Read-only

Returns advertising campaign performance or daily campaign performance. Summary reports support standardized campaign attribute and aggregated metric filters. When the user specifies any supported attribute or metric condition, pass it through filters in the first call; do not retrieve unfiltered pages and filter locally. Paginate only the filtered result. Always retain and present each campaign's current budget from budget.currencyAmount with budget.currencyCode. For budget changes, show current budget -> planned budget before requesting confirmation. Results can proceed to AD_CAMPAIGN_CHANGE for customer-confirmed daily-budget, ENABLED/PAUSED state, or name changes, and Sponsored Products, Sponsored Display, or Sponsored Brands campaigns can proceed to AD_AD_GROUP_CREATE. MCP reporting and workflow metric date ranges use yyyy-MM-dd and include both startDate and endDate, with at most 95 calendar days per range. For longer read-only reports, split into non-overlapping windows: endDate = startDate plus 94 days, capped at the requested end date; the next startDate is the previous endDate plus 1 day. Apply the same limit independently to comparison ranges. Do not average ratios such as ACOS or ROAS across windows; recompute them from summed base metrics. Do not automatically split advertising write plans or metric-based selectors; obtain a supported analysis window from the user. Keyword ranking trends have separate limits: DAILY supports up to 90 inclusive days and RAW up to 31 inclusive days. For keyword ranking trends, use these interval-specific limits when splitting read-only reports. This reporting limit does not apply to campaign scheduling dates.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of items to return. Defaults to 100 and cannot exceed 100.
offsetNoZero-based pagination offset.
sortByNoAdvertising performance sort field.
statesNoComma-separated campaign state filters. Allowed values are enabled, paused, and archived.
endDateYesEnd business date in yyyy-MM-dd format. Date range is inclusive and can contain at most 95 days. For longer read-only reports, use non-overlapping windows of up to 95 days.
filtersNoServer-side campaign filters. When the user supplies a supported condition, use this object in the first request instead of scanning unfiltered pages. Paginate only if the filtered response has more results.
storeIdYesStore ID from the Stores API, formatted as sellerId:marketplaceId.
sortOrderNoSort order.
startDateYesStart business date in yyyy-MM-dd format. Date range is inclusive and can contain at most 95 days. For longer read-only reports, use non-overlapping windows of up to 95 days.
reportTypeNoReport type.
campaignIdsNoComma-separated campaign ID filters, up to 100 values. Omit to include all campaigns.
campaignNameNoFuzzy campaign name filter.
portfolioIdsNoPortfolio IDs limiting the campaigns.
campaignTypesNoComma-separated campaign type filters. Allowed values are sponsoredProducts, sponsoredBrands, and sponsoredDisplay.
targetingTypesNoComma-separated targeting type filters. Allowed values are auto and manual.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the read-only safety profile, and the description adds real behavioral context beyond that: budget fields that must be surfaced (budget.currencyAmount with budget.currencyCode), the current->planned budget preview before confirmation, window-splitting rules, the 95-day cap, and the instruction not to average ratios across windows. The keyword-ranking-trend limits (90/31 days) are tangential to a campaign report and add noise rather than clarity.

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 purpose is front-loaded, but the remainder is a dense single-block wall covering budget presentation, workflow handoffs, date windows, ratio recomputation, keyword trend limits, and scheduling exclusions. The 95-day rule and window-splitting algorithm are stated repeatedly, and the keyword-ranking paragraph does not belong in a campaign-report description.

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?

An output schema exists, so return values need not be explained, and the description covers the pieces an agent must get right: date-window construction, ratio recomputation across windows, and the budget display requirement. What it lacks is any guidance on reportType selection (summary vs. daily) and on when filters are unsupported (it says summary-only only indirectly).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents limit, offset, states, filters, and date windows thoroughly. The description reinforces the filters directive with a worked example (ACoS > 35% becomes filters.metrics.acos.gt = 0.35), but that example is also present in the schema's filters description, so the added meaning is marginal — baseline 3 is appropriate.

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?

Opening sentence names a specific verb+resource ('Returns advertising campaign performance or daily campaign performance') and distinguishes summary vs. daily report types. It does not explicitly separate itself from the sibling query_advertising or query_advertising_ad_groups, which an agent might pick instead for adjacent scope.

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 concrete usage direction: push supported attribute/metric conditions into filters on the first call, paginate only the filtered result, and never fetch unfiltered pages for local filtering. It also names the downstream tools (AD_CAMPAIGN_CHANGE, AD_AD_GROUP_CREATE) this result feeds, but never states when a different query tool should be used instead.

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