Authenticate via the Amazon Ads API OAuth 2.0 flow and request an access token with the Amazon Advertising scope
POST a query definition to the AMC query endpoint, providing an SQL statement that joins the impressions, clicks, and purchases datasets and specifying a time window in the request body
Poll the query execution status endpoint using the returned query execution ID until the status field equals SUCCEEDED
Retrieve the S3 output location from the query result metadata, then use the provided pre-signed S3 URL (or Amazon Ads report download endpoint) to fetch the result file
Parse the downloaded gzipped JSON or CSV output and load it into your analytics store
Optionally schedule recurring queries by registering a workflow with a cron-style time_window_type and recurrence settings
Known gotchas
AMC SQL runs against event-level data with k-anonymity thresholds: rows with fewer than 100 users are suppressed, so queries returning niche segments may return empty results without error
Query execution can take minutes to hours depending on date range and complexity; always implement exponential back-off polling rather than tight loops
The AMC instance ID (entityId) is separate from your Advertising account entity ID; you must use the correct AMC instance ID when constructing the endpoint path
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp