Skip to main content
skill CX Codex

crontap-retries-and-idempotency — Claude Code skill: safe retries

Sets up Crontap retry policy and helps make a scheduled endpoint idempotent, so a repeated request does not create a second side effect.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-code
Open on GitHub

What crontap-retries-and-idempotency does

The skill walks the agent through a fixed order. First read recent run history and sort failures into classes. Then add idempotency on the receiving side. Only after that touch the retry policy over MCP. Two tools do the work: get_schedule_history for diagnosis and update_schedule for the change.

Allowed base delays are 30000, 60000, 300000 and 900000 milliseconds, and the retry count tops out at 5. 5xx, 429, network and timeout count as transient; add 4xx only if that particular endpoint is known to answer that way under load. Retrying auth or validation errors mostly adds traffic without more successful deliveries.

Custom policy needs Pro, Ultra or legacy Pro — Starter keeps the standard retry behaviour. Access runs either through the Crontap MCP server at https://mcp.crontap.com/mcp or through $CRONTAP_CLIENT_ID and $CRONTAP_API_KEY, and the raw API route is Ultra-only. Going the REST way is riskier: a PUT replaces the whole schedule, so skipping the GET can wipe headers, body and integrations. Keep the dedupe key out of process memory, because a restart or a second instance loses it.

What it helps with

  • tell transient schedule failures apart from permanent ones
  • make an endpoint survive the same job arriving twice
  • pick a delay and retry count that fit one endpoint
  • trace duplicates back to app logic instead of a Crontap retry
  • check that alerting fires on the final failure, not on a recovery

Example prompts for the agent

  • Read the history for <schedule-id> and tell me which failures are transient
  • Add idempotency to the handler and test it with two identical requests
  • Enable retries for <schedule-id> with a 60000 ms delay on 5xx and timeout

How to install crontap-retries-and-idempotency

1Skills CLI (Vercel)

npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-code

2Manually: put the files in place

~/.claude/skills/crontap-retries-and-idempotency/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/crontap-retries-and-idempotency/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about crontap-retries-and-idempotency

How do I install crontap-retries-and-idempotency in Claude Code?

Run npx skills add Crontap/skills --skill crontap-retries-and-idempotency -a claude-code. The skill file lands at ~/.claude/skills/crontap-retries-and-idempotency/SKILL.md.

What does crontap-retries-and-idempotency do?

It configures the retry policy of a Crontap schedule and prepares the endpoint to receive the same logical job more than once. It also covers cases where duplicates come from somewhere other than a retry.

What do I need before using it?

Either the Crontap MCP server at https://mcp.crontap.com/mcp, or $CRONTAP_CLIENT_ID and $CRONTAP_API_KEY for the raw API. Custom retry settings require Pro, Ultra or legacy Pro.

Source text

SKILL.md · MIT
---
name: crontap-retries-and-idempotency
description: >
  Configure Crontap retry policy safely and design scheduled endpoints so
  repeated requests do not duplicate side effects. Use when a user needs
  reliable delivery, exponential backoff, or help diagnosing duplicate work.
license: MIT
metadata:
  version: "1.0.1"
  group: patterns-migrations
  order: 7
  title: Make retries safe
  summary: Keep retries bounded and side effects idempotent, with the final delivery outcome visible in schedule history.
  bestFor: Backoff policies, duplicate prevention, and recovery
  guide: https://crontap.com/blog/introducing-automatic-retries-with-exponential-backoff
  guideTitle: Automatic retries
  tools: update_schedule,get_schedule_history
---

# Retries and idempotency

Retries improve delivery only when the endpoint can safely receive the same
logical job more than once. Make the receiver idempotent before broadening a
retry policy.

## Prerequisites

Before using the required tools, check whether they are available. If any are
missing, stop and offer the user exactly two choices:

1. Connect Crontap MCP at `https://mcp.crontap.com/mcp`. MCP access works on
   every Crontap tier.
2. Configure `$CRONTAP_CLIENT_ID` and `$CRONTAP_API_KEY` for the raw API. Raw
   API access requires Ultra.

Do not silently choose a path or continue until the user selects one.

- Identify the schedule and each side effect it can create.
- Decide which failures are transient for this endpoint.
- Choose a stable deduplication key and retention window.

## Workflow

1. Inspect recent history to classify failures.
2. Add endpoint idempotency and test duplicate requests.
3. Use MCP to update only the schedule's retry policy.
4. Verify a controlled transient failure and its eventual success.
5. Recheck history for attempt count, delay, and final outcome.

## MCP examples

Inspect failures before changing policy:

```json
{
  "tool": "get_schedule_history",
  "arguments": {
    "scheduleId": "<schedule-id>",
    "limit": 50
  }
}
```

Retry common transient classes:

```json
{
  "tool": "update_schedule",
  "arguments": {
    "scheduleId": "<schedule-id>",
    "retryPolicy": {
      "enabled": true,
      "maxRetries": 3,
      "baseDelayMs": 60000,
      "retryOn": ["5xx", "429", "network", "timeout"]
    }
  }
}
```

Allowed base delays are 30000, 60000, 300000, and 900000 milliseconds. The
maximum retry count is 5. Include `4xx` only when this specific endpoint uses a
known transient 4xx response.

## Endpoint idempotency pattern

Use a unique database constraint or atomic insert keyed by a logical job
identity:

```text
key = job-name + ":" + scheduled-period
insert key before side effects
if key already exists, return the recorded result
perform side effects once
store completion outcome
```

For money movement, email, provisioning, or external writes, pass the same key
to downstream systems that support idempotency. Do not rely on an in-memory
set, because restarts and multiple instances lose that protection.

## REST fallback

MCP partial update remains the preferred path and is not Ultra-only. A public
REST PUT is a full replacement, so never send only `retryPolicy`.

With Ultra credentials, GET the current full schedule first. Build a complete
replacement containing at least `url`, `verb`, `interval`, and `timezone`.
Preserve all other configuration fields, including headers, body, integrations,
and schedule options. Preserve credentials and secrets without logging them.
Change only `retryPolicy`, then PUT the complete replacement body to
`https://api.crontap.com/v1/schedule/<schedule-id>`.

## Verification

- Send the same logical request twice and verify one durable side effect.
- Induce a safe transient failure in a non-production target.
- Confirm history records the retries and final result expected by the policy.
- Confirm alerting occurs after the final failed outcome, not on a successful
  recovery.

## Safety and plan limits

- Custom retry policy settings require Pro, Ultra, or legacy Pro. Standard
  automatic retry behavior remains available on Starter.
- Retrying authentication and validation failures usually adds load without
  improving success.
- Never reduce idempotency retention below the maximum retry window.
- If configuration returns `RETRY_POLICY_NOT_CONFIGURABLE`, present the
  structured four-option ladder and smallest viable option.

## Troubleshooting

- Duplicate work with one history entry usually comes from application logic
  or another caller, not a Crontap retry.
- Duplicate work across attempts means the receiver's dedupe transaction is
  incomplete or scoped too narrowly.
- Repeated 429 responses require rate-limit coordination, not more attempts.
- A partial REST replacement can erase schedule settings. Re-fetch before
  retrying after a concurrent change.

## References

- [Crontap Agent Skills catalogue](https://crontap.com/skills)
- [Automatic retries with exponential backoff](https://crontap.com/blog/introducing-automatic-retries-with-exponential-backoff)
- [Cron troubleshooting](https://crontap.com/guides/cron-troubleshooting)
- [Cron job monitoring](https://crontap.com/cron-job-monitoring)
- [Live REST API reference](https://api.crontap.com/docs/)
- [Machine-readable product reference](https://crontap.com/llms.txt)

© Crontap · MIT · Crontap/skills

Similar skills

All skills for DevOps and infrastructure →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor