explain-error

explain-error is a command for Claude Code from paypal/AI-Toolkit. It costs 13 tokens per session (2,234 once invoked), scanned A, original, Apache-2.0.

A command that explains a PayPal API error, meaning a response from PayPal that says a request could not be completed.

In plain words
What is it for?
It helps interpret PayPal errors, add language-appropriate error handling, show a user-friendly message, decide whether retrying makes sense, and review related known errors.
Why use it?
It turns an error code or message into likely causes and concrete next steps, while warning when the error is unknown instead of presenting an unsupported explanation.

Command for Claude Code ✓ vendor

Written for Claude Code: allowed-tools in frontmatter.

Part of the paypal plugin — 2 skills, 5 commands, 1 MCP server shipped together

Good fit It helps interpret PayPal errors, add language-appropriate error handling, show a user-friendly message, decide whether retrying makes sense, and review related known errors.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/paypal/ai-toolkit/explain-error
About the project

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.

paypal/AI-Toolkit · 47 stars · on GitHub · developer.paypal.com

Install

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.

Clone the repo
git clone --depth 1 https://github.com/paypal/AI-Toolkit

Made for: Claude Code.

Or install paypal, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 1 MCP server.

Wrote 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.

agentmods badge for explain-error

README.md
[![agentmods](https://agentmods.dev/badge/commands/paypal/ai-toolkit/explain-error/github.svg)](https://agentmods.dev/commands/paypal/ai-toolkit/explain-error)
Your own site
<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.

agentmods 80×15 button for explain-error

Your own site · 80×15
<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>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,234 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash 4e9f00b411e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

commands/explain-error.md · 83 lines

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:

  1. What it means — plain-language explanation
  2. Common causes — most likely reasons this occurs
  3. How to fix it — specific, actionable steps
  4. 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.
  5. 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 the details[] array for the specific field and issue
  • UNAUTHORIZED (401) — expired or missing access token; refresh via POST /v1/oauth2/token
  • AUTHENTICATION_FAILURE (401) — missing Authorization header or invalid credentials; an expired bearer token usually comes back as invalid_token — mint a new token via POST /v1/oauth2/token
  • NOT_AUTHORIZED (403) — valid token but the app lacks the scope or feature for this operation (details[].issue is usually PERMISSION_DENIED); on GET /v1/reporting/balances or /v1/reporting/transactions it means Transaction Search is not enabled for the app — enable it in the Developer Dashboard (Apps & Credentials → your app → Features) and mint a new token
  • PERMISSION_DENIED (403) — account not eligible for this API; check Developer Dashboard feature eligibility
  • RESOURCE_NOT_FOUND (404) — resource ID does not exist or belongs to a different account
  • INVALID_RESOURCE_ID (404) — the issue behind 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 instead
  • PREVIOUS_REQUEST_IN_PROGRESS (409 RESOURCE_CONFLICT) — a request with the same PayPal-Request-Id is still being processed; wait, then retry with the same ID — do not generate a new one
  • RATE_LIMIT_REACHED (429) — back off with exponential retry; honor the Retry-After header
  • INTERNAL_SERVER_ERROR (500) — retry with the same PayPal-Request-Id idempotency key; log debug_id

Orders v2:

  • INSTRUMENT_DECLINED (422) — buyer's payment method declined; ask for a different payment method, do not retry the same instrument
  • TRANSACTION_REFUSED (422) — risk engine decline; do not retry automatically
  • ORDER_NOT_APPROVED (422) — the buyer has not approved the order yet; send them to the rel: approve link (or wait for the JS SDK onApprove callback) before calling capture or authorize
  • ORDER_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 retrying
  • ORDER_ALREADY_COMPLETED (422) — a completed order cannot be patched; create a new order instead
  • PAYER_ACTION_REQUIRED (422) — the buyer must complete a step (3D Secure, bank or APM approval) before the order can be captured; redirect them to the rel: payer-action HATEOAS link, then retry
  • AMOUNT_MISMATCH (422) — amount.value must equal item_total + tax_total + shipping + handling + insurance - shipping_discount - discount from amount.breakdown
  • PAYPAL_REQUEST_ID_REQUIRED (400) — creating an order with a payment_source requires a PayPal-Request-Id header

Read the full file on GitHub · 83 lines

Changes

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.

  1. 1mo ago Changed · +46 lines 4e9f00b411e1
  2. 3mo ago First seen · 37 lines · 13 tokens per session scan A d35183b3f68a

Subscribe to this mod's changes

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.

Related

explain-error compared with commands from other repositories

explain-error next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
explain-errorpaypal/AI-ToolkitCommand471mo agoApache-2.0A13Claude Code
techdebtoliver-kriska/claude-elixir-phoenixCommand5804d agoMITA13Claude Code
cgwidnyana/eyay-toolkitsCommand917d agoMITA15Claude Code
deep-code-analysisfusengine/agentsCommand341mo agoMITA28Claude Code
watchfusengine/agentsCommand341mo agoMITA23Claude Code
nyann:retrofitthettwe/nyannCommand726d agoMITA61Claude Code
doctorModellix/modellix-pluginCommand13d agoMITA16Claude Code