feat(shopping): add rate_limit_exceeded error for agent retry signaling#622
Open
prasad-stripe wants to merge 2 commits into
Open
feat(shopping): add rate_limit_exceeded error for agent retry signaling#622prasad-stripe wants to merge 2 commits into
prasad-stripe wants to merge 2 commits into
Conversation
Committed-By-Agent: claude
|
Hi @prasad-stripe, thank you for submitting this PR. It looks like the Lint Code Base check is currently failing - could you please take a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add rate_limit_exceeded error (code -32004) to the MCP Shopping service and declare it on all 13 methods. Any method can be rate-limited; agents need a structured signal to distinguish "slow down" from "your request is broken."
Why this matters
UCP is agent-native. Agents operating in automated loops will hit rate limits from merchant implementations. Without a declared error code, agents cannot distinguish retriable throttling from permanent failures, leading to either blind retries (hammering the merchant) or premature abandonment (degraded UX).
Code -32004 follows MCP conventions: implementation-defined range (-32000 to -32019) for server-specific conditions that clients must act on distinctly (ref: MCP spec schema.ts allocates -32020+ for protocol-defined codes, leaving -32000 to -32019 for implementations like UCP).
The data payload uses existing error_response.json, consistent with all other MCP errors. The content field can carry retry-after hints in human-readable form; a structured retry_after field can be proposed separately if the TC wants machine-readable backoff.
Test plan