PayPal AI Toolkit is a plugin that connects AI coding agents with PayPal APIs and sandbox MCP servers, giving them PayPal-specific guidance and tools. It helps developers build and work with payment, subscription, invoice, and dispute integrations in Claude Code, OpenAI Codex, and other compatible agents. The catalogue entries are its commands, skills, plugins, and MCP integration.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/paypal/AI-ToolkitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/paypal/ai-toolkit/explain-error)<a href="https://agentmods.dev/commands/paypal/ai-toolkit/explain-error"><img src="https://agentmods.dev/badge/commands/paypal/ai-toolkit/explain-error/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/paypal/ai-toolkit/explain-error"><img src="https://agentmods.dev/badge/commands/paypal/ai-toolkit/explain-error.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00013 | $0.02234 |
| Opus 5.5 | $0.00005 | $0.00894 |
| Sonnet 5.5 | $0.00003 | $0.00447 |
| Haiku 4.5 | $0.00001 | $0.00223 |
Grade A, and why
explain-error scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
If "$ARGUMENTS" is empty, respond only with: "Please provide a PayPal error code or message. Example: /paypal:explain-error INSTRUMENT_DECLINED" and stop.
If "$ARGUMENTS" does not match any known PayPal error code or message pattern, respond with: "Unknown error code or message: $ARGUMENTS. This may be a typo, a third-party error, or a new PayPal error not yet in this reference. Check https://developer.paypal.com/api/rest/reference/orders/v2/errors/ (Orders v2), https://developer.paypal.com/api/rest/responses/ (HTTP status codes), or the Errors section of the relevant API reference (Vault: https://developer.paypal.com/api/payment-tokens/v3, Payouts: https://developer.paypal.com/api/payments.payouts-batch/v1, Webhooks: https://developer.paypal.com/api/webhooks/v1) for the full list." Then do your best to explain what the error string suggests based on its name, and stop — do not fabricate retry behavior or related errors.
Otherwise, explain the PayPal error "$ARGUMENTS". Provide:
- What it means — plain-language explanation
- Common causes — most likely reasons this occurs
- How to fix it — specific, actionable steps
- Code example — detect the user's programming language by scanning any open files with Read/Grep; default to Node.js if no language is found. Show proper error handling including how to catch the error, display a user-friendly message, and whether to retry.
- Related errors — only list errors from the Key error reference below that are meaningfully related (same HTTP status, same flow, or must be handled together). Do not suggest errors outside this list.
Key error reference:
General (any API):
INVALID_REQUEST(400) — malformed body or missing fields; inspect thedetails[]array for the specificfieldandissueUNAUTHORIZED(401) — expired or missing access token; refresh viaPOST /v1/oauth2/tokenAUTHENTICATION_FAILURE(401) — missingAuthorizationheader or invalid credentials; an expired bearer token usually comes back asinvalid_token— mint a new token viaPOST /v1/oauth2/tokenNOT_AUTHORIZED(403) — valid token but the app lacks the scope or feature for this operation (details[].issueis usuallyPERMISSION_DENIED); onGET /v1/reporting/balancesor/v1/reporting/transactionsit means Transaction Search is not enabled for the app — enable it in the Developer Dashboard (Apps & Credentials → your app → Features) and mint a new tokenPERMISSION_DENIED(403) — account not eligible for this API; check Developer Dashboard feature eligibilityRESOURCE_NOT_FOUND(404) — resource ID does not exist or belongs to a different accountINVALID_RESOURCE_ID(404) — theissuebehind most 404s (Orders, Payments, Payouts, Webhooks, Transaction Search): the ID is mistyped, belongs to another account, or was created in the other environment (sandbox vs. live)DUPLICATE_TRANSACTION(409) — idempotency key already succeeded; retrieve the existing resource insteadPREVIOUS_REQUEST_IN_PROGRESS(409RESOURCE_CONFLICT) — a request with the samePayPal-Request-Idis still being processed; wait, then retry with the same ID — do not generate a new oneRATE_LIMIT_REACHED(429) — back off with exponential retry; honor theRetry-AfterheaderINTERNAL_SERVER_ERROR(500) — retry with the samePayPal-Request-Ididempotency key; logdebug_id
Orders v2:
INSTRUMENT_DECLINED(422) — buyer's payment method declined; ask for a different payment method, do not retry the same instrumentTRANSACTION_REFUSED(422) — risk engine decline; do not retry automaticallyORDER_NOT_APPROVED(422) — the buyer has not approved the order yet; send them to therel: approvelink (or wait for the JS SDKonApprovecallback) before calling capture or authorizeORDER_ALREADY_CAPTURED/ORDER_ALREADY_AUTHORIZED(422) — only one capture (intent=CAPTURE) or one authorization (intent=AUTHORIZE) is allowed per order;GET /v2/checkout/orders/{id}to recover the existing capture or authorization ID instead of retryingORDER_ALREADY_COMPLETED(422) — a completed order cannot be patched; create a new order insteadPAYER_ACTION_REQUIRED(422) — the buyer must complete a step (3D Secure, bank or APM approval) before the order can be captured; redirect them to therel: payer-actionHATEOAS link, then retryAMOUNT_MISMATCH(422) —amount.valuemust equalitem_total + tax_total + shipping + handling + insurance - shipping_discount - discountfromamount.breakdownPAYPAL_REQUEST_ID_REQUIRED(400) — creating an order with apayment_sourcerequires aPayPal-Request-Idheader
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +46 lines 4e9f00b411e1
- 3mo ago First seen · 37 lines · 13 tokens per session scan A d35183b3f68a
explain-error is a command published in the GitHub repository paypal/AI-Toolkit (47 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 2,234 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
explain-error compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| explain-errorpaypal/AI-Toolkit | Command | 47 | 1mo ago | Apache-2.0 | A | 13 | Claude Code |
| techdebtoliver-kriska/claude-elixir-phoenix | Command | 580 | 4d ago | MIT | A | 13 | Claude Code |
| cgwidnyana/eyay-toolkits | Command | 9 | 17d ago | MIT | A | 15 | Claude Code |
| deep-code-analysisfusengine/agents | Command | 34 | 1mo ago | MIT | A | 28 | Claude Code |
| watchfusengine/agents | Command | 34 | 1mo ago | MIT | A | 23 | Claude Code |
| nyann:retrofitthettwe/nyann | Command | 7 | 26d ago | MIT | A | 61 | Claude Code |
| doctorModellix/modellix-plugin | Command | 1 | 3d ago | MIT | A | 16 | Claude Code |