{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adako-ai/json-schema/adako-ai-success-envelope-schema.json",
  "title": "SuccessEnvelope",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adako-ai-openapi.json#/components/schemas/SuccessEnvelope",
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "tool": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "additionalProperties": true,
      "description": "Machine-readable result."
    },
    "markdown": {
      "type": "string",
      "description": "The same result written for a person or a model."
    },
    "quota": {
      "$ref": "#/$defs/Quota"
    },
    "proposal_id": {
      "type": "string",
      "description": "Present for writes. Nothing changes on the ad platform until it is approved."
    },
    "approve_url": {
      "type": "string",
      "description": "Where a person approves the proposal."
    },
    "request_id": {
      "type": "string"
    }
  },
  "required": [
    "success",
    "tool",
    "data",
    "markdown",
    "request_id"
  ],
  "$defs": {
    "Quota": {
      "type": "object",
      "description": "Task usage for the current billing period.",
      "properties": {
        "plan": {
          "type": "string"
        },
        "used": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "period_end": {
          "type": "string"
        },
        "upgrade_url": {
          "type": "string"
        }
      }
    }
  }
}