{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stormmcp/json-schema/stormmcp-library-approval-grants-response-schema.json",
  "title": "LibraryApprovalGrantsResponse",
  "description": "Every approval grant on one library, per principal — the PRD AS4 principal list and the\nper-library half of AS6 inherited rendering (MCPG-1547).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stormmcp-approvals-api-openapi.yml#/components/schemas/LibraryApprovalGrantsResponse",
  "required": [
    "libraryId",
    "grants"
  ],
  "type": "object",
  "properties": {
    "libraryId": {
      "type": "string",
      "description": "Gets the library id.",
      "format": "uuid"
    },
    "grants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApprovalGrantResponse"
      },
      "description": "Gets the grant rows, ordered by principal."
    }
  },
  "$defs": {
    "ApprovalGrantResponse": {
      "required": [
        "libraryId",
        "principalType",
        "principalId",
        "grantsAppAccess",
        "toolMode",
        "selectedToolNames",
        "createdAt",
        "updatedAt"
      ],
      "type": "object",
      "properties": {
        "libraryId": {
          "type": "string",
          "description": "Gets the library the grant targets.",
          "format": "uuid"
        },
        "principalType": {
          "description": "Gets the principal kind.",
          "$ref": "#/$defs/ApprovalPrincipalType"
        },
        "principalId": {
          "type": "string",
          "description": "Gets the principal id — Guid Guid.Empty for AllUsers, else the platform\ngroup/user GUID.",
          "format": "uuid"
        },
        "grantsAppAccess": {
          "type": "boolean",
          "description": "Gets a value indicating whether the row confers app access (meaningful on AllUsers\nrows only — Group/User rows confer by definition)."
        },
        "toolMode": {
          "description": "Gets the tool scope.",
          "$ref": "#/$defs/ApprovalToolMode"
        },
        "selectedToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Gets the selected canonical upstream tool names (empty when ApprovalToolMode ApprovalGrantResponse.ToolMode is\nApprovalToolMode.All — symbolic, never materialized)."
        },
        "createdAt": {
          "type": "string",
          "description": "Gets the row creation time.",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "description": "Gets the row's last update time.",
          "format": "date-time"
        }
      },
      "description": "One principal-scoped approval grant row (MCPG-1547 admin read). The enums reach the\nTypeScript client by DTO reference — deliberately NOT registered in\n`StandaloneEnumSchemaProcessor` (a string-constant-class registrar; registering a C#\nenum there clobbers NSwag's schema into an untyped string)."
    },
    "ApprovalPrincipalType": {
      "type": "integer",
      "description": "The principal an approval grant row is scoped to (MCPG-1547). Feature-prefixed —\ndeliberately not shared with GatewayAccessPrincipalType or\nAdminToolkitPrincipalType so the member sets can evolve independently.\nStored as a string through the strict `ApprovalPrincipalTypeConverter` (unknown\nstore values throw; never bare `HasConversion&lt;string&gt;()`)."
    },
    "ApprovalToolMode": {
      "type": "integer"
    }
  }
}