Skip to content

feat(shopping): add rate_limit_exceeded error for agent retry signaling#622

Open
prasad-stripe wants to merge 2 commits into
mainfrom
prasad-stripe/mcp-rate-limit-error
Open

feat(shopping): add rate_limit_exceeded error for agent retry signaling#622
prasad-stripe wants to merge 2 commits into
mainfrom
prasad-stripe/mcp-rate-limit-error

Conversation

@prasad-stripe

Copy link
Copy Markdown

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

  • Valid OpenRPC 1.3.2 JSON
  • Code -32004 does not conflict with existing codes (-32002, -32003)
  • All 13 methods reference the new error
  • Declaration-only; no behavioral change

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Jul 21, 2026
@carolinerg1 carolinerg1 added status:under-review gov:needs-tc-review and removed status:needs-triage Signal that the PR is ready for human triage labels Jul 21, 2026
@carolinerg1

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants