Skip to content

Correct the Amazon Ads rate limit note in the adapter - #1648

Merged
helpcodeai merged 2 commits into
mainfrom
fix/amazon-ads-429-wording
Nov 12, 2026
Merged

helpcodeai merged 2 commits into
mainfrom
fix/amazon-ads-429-wording

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

The Amazon Ads adapter instructions said "Amazon throttles per account and endpoint and answers 429 with Retry-After; wait and retry." Amazon publishes no fixed rate limits for the Ads API, and a 429 does not always carry a Retry-After header.

The REST engine (retryDelayMs in rest.engine.ts) retries a 429 exactly once: after Retry-After when it is 3 s or less, after about 1 s when there is none, and not at all when Retry-After is longer. The model then sees the 429 and the header in the error. The instructions now say that, and tell the model to wait before calling again and not to poll report status in a tight loop.

Changes

  • packages/backend/src/adapters/intl/amazon-ads.json, instructions: the Limits. sentence now reads "Amazon publishes no fixed rate limits: it throttles per account and endpoint, and a 429 does not always carry Retry-After. AnythingMCP retries a throttled call once; if it is throttled again, wait before calling again and do not poll report status in a tight loop." The token sentence after it is unchanged.
  • Same file, verifyHints.rate_limited: "Wait before trying again (for the Retry-After time, when Amazon sends one)." instead of assuming the header is always there.
  • catalog.ts: node scripts/regenerate-catalog.mjs produced no diff (it does not embed instructions).
  • amazon-seller.json does not make the "429 with Retry-After" claim, so it is unchanged.

Cloud and self-hosted behave the same: this only changes text the model reads.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

All from a worktree of origin/main (1f5edfa):

  • Repo root: node scripts/validate-adapters.mjs --warn: exit 0, 1434 warnings, output identical to the same run on origin/main (no new warnings; none for amazon-ads).

  • Repo root: node scripts/regenerate-catalog.mjs: "748 adapters across 21 regions", no diff.

  • Repo root: node scripts/adapter-count.mjs --check: "OK: every quoted count equals 732 adapters (42 keyless, 13312 tools)."

  • packages/backend: npx jest src/adapters/intl/amazon-ads --maxWorkers=4: 1 suite, 6 tests passed. The worktree had no node_modules, so this ran with the main checkout's node_modules symlinked in, whose lockfile differs from main; CI is the authoritative run.

  • Full backend lint / tsc / test suites not run locally (JSON text change only); left to CI.

  • Added/updated unit tests

  • Tested manually (describe steps below)

  • No tests needed (explain why): text-only change to adapter instructions; the existing static spec covers the file's structure.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test) (left to CI, see above)
  • This PR has a descriptive title

Related Issues

Same correction on the website guides: HelpCode-ai/anythingmcp-website#566.

The instructions said Amazon answers 429 with Retry-After. Amazon
publishes no fixed rate limits for the Ads API and a 429 does not always
carry Retry-After. The REST engine retries a 429 once, so tell the model
to wait before calling again if it is throttled a second time and not to
poll report status in a tight loop. The rate_limited verify hint no
longer assumes a Retry-After header either.
@helpcodeai
helpcodeai requested a review from D3nisty as a code owner November 12, 2026 16:52
@helpcodeai
helpcodeai merged commit dbadb8d into main Nov 12, 2026
16 checks passed
@helpcodeai
helpcodeai deleted the fix/amazon-ads-429-wording branch November 12, 2026 17:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant