{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stormmcp/json-schema/stormmcp-library-approval-grants-summary-response-schema.json",
  "title": "LibraryApprovalGrantsSummaryResponse",
  "description": "The bulk grants summary (MCPG-1890): one entry per distinct requested library, in\nrequest order, including libraries with no grant rows (reported\nAppAccessCoverage.None), so a consumer never has to treat an absent entry\nas a state.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stormmcp-approvals-api-openapi.yml#/components/schemas/LibraryApprovalGrantsSummaryResponse",
  "required": [
    "libraries"
  ],
  "type": "object",
  "properties": {
    "libraries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LibraryApprovalGrantSummaryResponse"
      },
      "description": "Gets the per-library summaries, in request order."
    }
  },
  "$defs": {
    "AppAccessCoverage": {
      "type": "integer",
      "description": "Who a library's app access covers, derived from its approval grant rows (MCPG-1890). A\ndomain classification rather than a UI state: only the gateway knows that a scope-only\n`AllUsers` row confers nothing, so the answer is computed here and consumers render\nit as they like (Server Management shows Approved / Limited / Not Approved). Deliberately\nnot named \"scope\", which across this feature means a principal's <em>tool</em> scope.\nReaches the TypeScript client by DTO reference — deliberately NOT registered in\n`StandaloneEnumSchemaProcessor` (see ApprovalGrantResponse).\nAppAccessCoverage.None is the zero member so a defaulted value is the narrowest reading."
    },
    "LibraryApprovalGrantSummaryResponse": {
      "required": [
        "libraryId",
        "appAccessCoverage",
        "userCount",
        "groupCount"
      ],
      "type": "object",
      "properties": {
        "libraryId": {
          "type": "string",
          "description": "Gets the library id.",
          "format": "uuid"
        },
        "appAccessCoverage": {
          "description": "Gets who the library's app access covers.",
          "$ref": "#/$defs/AppAccessCoverage"
        },
        "userCount": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets the number of individually approved users (`User` grant rows).",
          "format": "int32"
        },
        "groupCount": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "description": "Gets the number of approved groups (`Group` grant rows).",
          "format": "int32"
        }
      },
      "description": "One library's app-access coverage plus the principal counts behind it (\"3 users,\n2 groups\") — enough for the Server Management grid's badge and tooltip without a per-row\ngrants read (MCPG-1890)."
    }
  }
}