{
  "openapi": "3.0.1",
  "info": {
    "title": "Retry Oracle MCP Server: Retry, Mutate or Abort API Calls",
    "description": "Retry Oracle for AI agents and MCP clients: send a failed API call (status, raw headers, error, attempt) and get RETRY, MUTATE or ABORT with delay, retryAt and a shared circuit breaker. AI integrations, MCP server, developer tools.",
    "version": "2.0",
    "x-build-id": "glI1aZWj6rTJFZdl5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/skilled_glee~retry-oracle-agent-utility/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-skilled_glee-retry-oracle-agent-utility",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/skilled_glee~retry-oracle-agent-utility/runs": {
      "post": {
        "operationId": "runs-sync-skilled_glee-retry-oracle-agent-utility",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/skilled_glee~retry-oracle-agent-utility/run-sync": {
      "post": {
        "operationId": "run-sync-skilled_glee-retry-oracle-agent-utility",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "decide",
              "audit"
            ],
            "type": "string",
            "description": "decide = RETRY/MUTATE/ABORT per item. audit = replay a failure log (datasetId or log) and report wasted retries, wasted spend and suggested policy.",
            "default": "decide"
          },
          "items": {
            "title": "Failure contexts (decide mode)",
            "type": "array",
            "description": "1-1000 failures. Raw mode needs only attempt plus statusCode or errorMessage; headers, method, provider, key, sessionId are optional. Legacy retry-oracle items (failureCategory, attemptNumber, maxAttempts, ...) are also accepted.",
            "default": [
              {
                "attempt": 1,
                "statusCode": 429,
                "headers": {
                  "Retry-After": "5"
                },
                "method": "GET",
                "key": "api.example.com"
              },
              {
                "attempt": 2,
                "errorMessage": "read ECONNRESET",
                "method": "POST"
              }
            ]
          },
          "preset": {
            "title": "Policy preset",
            "enum": [
              "conservative",
              "aggressive",
              "paid-api",
              "idempotent-by-method"
            ],
            "type": "string",
            "description": "Default policy for items that do not set their own preset.",
            "default": "conservative"
          },
          "provider": {
            "title": "Provider (optional)",
            "enum": [
              "openai",
              "anthropic",
              "stripe",
              "github",
              "shopify",
              "apify",
              "generic"
            ],
            "type": "string",
            "description": "Optional default provider profile; otherwise detected from url or headers."
          },
          "sessionId": {
            "title": "Session ID (optional)",
            "type": "string",
            "description": "Track amountSpent server-side across calls."
          },
          "explain": {
            "title": "Explain",
            "type": "boolean",
            "description": "Include the rule trace showing which rule fired.",
            "default": false
          },
          "dryRun": {
            "title": "Dry run",
            "type": "boolean",
            "description": "Do not update circuit or session state. Still a billed decision.",
            "default": false
          },
          "datasetId": {
            "title": "Failure-log dataset (audit mode)",
            "type": "string",
            "description": "Dataset whose items are attempt records: requestId, attempt, statusCode, headers, errorMessage, method, timestamp, cost."
          },
          "log": {
            "title": "Failure log (audit mode)",
            "type": "array",
            "description": "Inline attempt records (same shape as dataset items) if you do not use datasetId."
          },
          "defaultAttemptCost": {
            "title": "Default attempt cost (audit)",
            "minimum": 0,
            "type": "number",
            "description": "Cost per attempt when a record has no cost field."
          },
          "maxEntries": {
            "title": "Max log entries (audit)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of log entries read in audit mode (1-10000).",
            "default": 1000
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store in your account that holds circuit and session state ('none' = memory only).",
            "default": "retry-oracle-state"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}