{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stormmcp/json-schema/stormmcp-activity-response-schema.json",
  "title": "ActivityResponse",
  "description": "Current-user dynamic gateway activity projection (MCPG-1156).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stormmcp-dynamicgateway-api-openapi.yml#/components/schemas/ActivityResponse",
  "type": "object",
  "properties": {
    "aggregates": {
      "description": "Gets or sets the windowed aggregates.\nDeprecated. Existing readers still receive this field. Removal is MCPG-2186.",
      "$ref": "#/$defs/ActivityAggregatesResponse"
    },
    "series7d": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivitySeriesPointResponse"
      },
      "description": "Gets or sets the fixed 7-day daily series.\nDeprecated. Existing readers still receive this field. Removal is MCPG-2186.\nDay keys are UTC. A client that needs local days sums IReadOnlyList&lt;ActivityBucket20mResponse&gt; ActivityResponse.Buckets20m."
    },
    "series24h": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivitySeries24hBucketResponse"
      },
      "description": "Gets or sets the fixed 24-hour outcome-split series (72 × 20-min buckets, AI-51). Window-independent."
    },
    "buckets20m": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivityBucket20mResponse"
      },
      "description": "Gets or sets 768 UTC-aligned 15-minute buckets covering 8 x 24h (MCPG-2192).\nThe JSON name `buckets20m` is historical. The last bucket contains now.\nDateTimeOffset ActivityResponse.WindowStart is the first bucket start\nand DateTimeOffset ActivityResponse.WindowEnd is the exclusive end of the last bucket."
    },
    "windowStart": {
      "type": "string",
      "description": "Gets or sets the UTC start of the first IReadOnlyList&lt;ActivityBucket20mResponse&gt; ActivityResponse.Buckets20m bucket.",
      "format": "date-time"
    },
    "windowEnd": {
      "type": "string",
      "description": "Gets or sets the exclusive UTC end of the last IReadOnlyList&lt;ActivityBucket20mResponse&gt; ActivityResponse.Buckets20m bucket.",
      "format": "date-time"
    },
    "recent": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivityRecentRowResponse"
      },
      "description": "Gets or sets the latest matching tool-call rows. An outcome, client, or tool-name\nquery is applied before the cap of 50. This list is not a total. Older calls stay\nin MCP Monitoring."
    }
  },
  "$defs": {
    "ActivityAggregatesResponse": {
      "type": "object",
      "properties": {
        "calls": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the total tool calls in the window.",
          "format": "int32"
        },
        "toolsUsed": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the distinct tools used in the window.",
          "format": "int32"
        },
        "failures": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the failed calls in the window.",
          "format": "int32"
        },
        "denied": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the policy-denied calls in the window.",
          "format": "int32"
        }
      },
      "description": "Windowed activity aggregates."
    },
    "ActivityBucket20mResponse": {
      "type": "object",
      "properties": {
        "bucketStart": {
          "type": "string",
          "description": "Gets or sets the UTC start of the 15-minute bucket (aligned to a 15-min boundary).",
          "format": "date-time"
        },
        "succeeded": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the successful tool calls in the bucket.",
          "format": "int32"
        },
        "failed": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the failed tool calls in the bucket.",
          "format": "int32"
        },
        "denied": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the policy-denied tool calls in the bucket.",
          "format": "int32"
        },
        "unknown": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the tool calls whose status did not map to Succeeded/Failed/Denied (AI-58).",
          "format": "int32"
        },
        "toolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Gets or sets the distinct tool names in this bucket, sorted.\nEmpty when the bucket has no named calls. Scoped to the calling user, same as the rest of me/activity (MCPG-2203)."
        }
      },
      "description": "One 15-minute bucket (MCPG-2192; the type name is historical); start is a UTC instant; the client decides day and hour boundaries."
    },
    "ActivityOutcome": {
      "type": "integer",
      "description": "Outcome of a recorded tool call (MCPG-1156), mapped from the request-log status."
    },
    "ActivityRecentRowResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Gets or sets the request-log row identifier (the key for the call-detail lookup, AI-50).",
          "format": "uuid"
        },
        "timestamp": {
          "type": "string",
          "description": "Gets or sets the call start time.",
          "format": "date-time"
        },
        "toolName": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the tool name, or null when it was not captured."
        },
        "durationMs": {
          "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
          "type": [
            "number",
            "string"
          ],
          "description": "Gets or sets the call duration in milliseconds.",
          "format": "double"
        },
        "outcome": {
          "description": "Gets or sets the mapped outcome.",
          "$ref": "#/$defs/ActivityOutcome"
        },
        "client": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the client name resolved from the session registry, or null when unknown (AI-50)."
        },
        "sessionId": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the opaque MCP session id, or null when unknown (AI-50)."
        },
        "toolkit": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the best-effort enabling toolkit name, or null when unknown."
        },
        "libraryId": {
          "type": [
            "null",
            "string"
          ],
          "description": "Gets or sets the best-effort owning library id from live surface attribution, or null for\ngateway-native (`radar_*`) and unattributable rows (MCPG-1528).",
          "format": "uuid"
        }
      },
      "description": "One recent tool-call row. `client` and `sessionId` are omitted when unknown (AI-50)."
    },
    "ActivitySeries24hBucketResponse": {
      "type": "object",
      "properties": {
        "bucketStart": {
          "type": "string",
          "description": "Gets or sets the UTC start of the 20-minute bucket (aligned to a 20-min boundary).",
          "format": "date-time"
        },
        "succeeded": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the successful tool calls in the bucket.",
          "format": "int32"
        },
        "failed": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the failed tool calls in the bucket.",
          "format": "int32"
        },
        "denied": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the policy-denied tool calls in the bucket.",
          "format": "int32"
        },
        "unknown": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the tool calls whose status did not map to Succeeded/Failed/Denied (AI-58).",
          "format": "int32"
        }
      },
      "description": "One 20-minute bucket of the 24-hour outcome-split series (AI-51)."
    },
    "ActivitySeriesPointResponse": {
      "type": "object",
      "properties": {
        "day": {
          "type": "string",
          "description": "Gets or sets the day.",
          "format": "date"
        },
        "calls": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets or sets the tool-call count on that day.",
          "format": "int32"
        }
      },
      "description": "One day of the 7-day series."
    }
  }
}