GitHub · Capability

github-repos-api — Protections

github-repos-api — Protections. 15 operations. Lead operation: GitHub Get Branch Protection. Self-contained Naftiko capability covering one Github business surface.

Run with Naftiko GithubProtections

What You Can Do

GET
Getbranchprotection — GitHub Get Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
PUT
Updatebranchprotection — GitHub Update Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
DELETE
Deletebranchprotection — GitHub Delete Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
GET
Getadminbranchprotection — GitHub Get Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
POST
Setadminbranchprotection — GitHub Set Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
DELETE
Deleteadminbranchprotection — GitHub Delete Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
GET
Getpullrequestreviewprotection — GitHub Get Pull Request Review Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-pull-request-reviews
PATCH
Updatepullrequestreviewprotection — GitHub Update Pull Request Review Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-pull-request-reviews
DELETE
Deletepullrequestreviewprotection — GitHub Delete Pull Request Review Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-pull-request-reviews
GET
Getcommitsignatureprotection — GitHub Get Commit Signature Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-signatures
POST
Createcommitsignatureprotection — GitHub Create Commit Signature Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-signatures
DELETE
Deletecommitsignatureprotection — GitHub Delete Commit Signature Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-signatures
GET
Getstatuschecksprotection — GitHub Get Status Checks Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-status-checks
PATCH
Updatestatuscheckprotection — GitHub Update Status Check Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-status-checks
DELETE
Removestatuscheckprotection — GitHub Remove Status Check Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/required-status-checks

MCP Tools

github-get-branch-protection

GitHub Get Branch Protection

read-only idempotent
github-update-branch-protection

GitHub Update Branch Protection

idempotent
github-delete-branch-protection

GitHub Delete Branch Protection

idempotent
github-get-admin-branch-protection

GitHub Get Admin Branch Protection

read-only idempotent
github-set-admin-branch-protection

GitHub Set Admin Branch Protection

github-delete-admin-branch-protection

GitHub Delete Admin Branch Protection

idempotent
github-get-pull-request-review

GitHub Get Pull Request Review Protection

read-only idempotent
github-update-pull-request-review

GitHub Update Pull Request Review Protection

idempotent
github-delete-pull-request-review

GitHub Delete Pull Request Review Protection

idempotent
github-get-commit-signature-protection

GitHub Get Commit Signature Protection

read-only idempotent
github-create-commit-signature-protection

GitHub Create Commit Signature Protection

github-delete-commit-signature-protection

GitHub Delete Commit Signature Protection

idempotent
github-get-status-checks-protection

GitHub Get Status Checks Protection

read-only idempotent
github-update-status-check-protection

GitHub Update Status Check Protection

idempotent
github-remove-status-check-protection

GitHub Remove Status Check Protection

idempotent

Capability Spec

repo-branches-protections.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: github-repos-api — Protections
  description: 'github-repos-api — Protections. 15 operations. Lead operation: GitHub Get Branch Protection. Self-contained
    Naftiko capability covering one Github business surface.'
  tags:
  - Github
  - Protections
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GITHUB_API_KEY: GITHUB_API_KEY
capability:
  consumes:
  - type: http
    namespace: repo-branches-protections
    baseUri: ''
    description: github-repos-api — Protections business capability. Self-contained, no shared references.
    resources:
    - name: repos-owner-repo-branches-branch-protection
      path: /repos/{owner}/{repo}/branches/{branch}/protection
      operations:
      - name: getbranchprotection
        method: GET
        description: GitHub Get Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: updatebranchprotection
        method: PUT
        description: GitHub Update Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletebranchprotection
        method: DELETE
        description: GitHub Delete Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
    - name: repos-owner-repo-branches-branch-protection-enforce_admins
      path: /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
      operations:
      - name: getadminbranchprotection
        method: GET
        description: GitHub Get Admin Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: setadminbranchprotection
        method: POST
        description: GitHub Set Admin Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: deleteadminbranchprotection
        method: DELETE
        description: GitHub Delete Admin Branch Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
    - name: repos-owner-repo-branches-branch-protection-required_pull_request_reviews
      path: /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews
      operations:
      - name: getpullrequestreviewprotection
        method: GET
        description: GitHub Get Pull Request Review Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: updatepullrequestreviewprotection
        method: PATCH
        description: GitHub Update Pull Request Review Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: deletepullrequestreviewprotection
        method: DELETE
        description: GitHub Delete Pull Request Review Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
    - name: repos-owner-repo-branches-branch-protection-required_signatures
      path: /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
      operations:
      - name: getcommitsignatureprotection
        method: GET
        description: GitHub Get Commit Signature Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: createcommitsignatureprotection
        method: POST
        description: GitHub Create Commit Signature Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: deletecommitsignatureprotection
        method: DELETE
        description: GitHub Delete Commit Signature Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
    - name: repos-owner-repo-branches-branch-protection-required_status_checks
      path: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
      operations:
      - name: getstatuschecksprotection
        method: GET
        description: GitHub Get Status Checks Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
      - name: updatestatuscheckprotection
        method: PATCH
        description: GitHub Update Status Check Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: removestatuscheckprotection
        method: DELETE
        description: GitHub Remove Status Check Protection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Authorization
          in: header
          type: string
        - name: X-GitHub-Api-Version
          in: header
          type: string
        - name: Accept
          in: header
          type: string
    authentication:
      type: bearer
      token: '{{env.GITHUB_API_KEY}}'
  exposes:
  - type: rest
    namespace: repo-branches-protections-rest
    port: 8080
    description: REST adapter for github-repos-api — Protections. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/repos/{owner}/{repo}/branches/{branch}/protection
      name: repos-owner-repo-branches-branch-protection
      description: REST surface for repos-owner-repo-branches-branch-protection.
      operations:
      - method: GET
        name: getbranchprotection
        description: GitHub Get Branch Protection
        call: repo-branches-protections.getbranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatebranchprotection
        description: GitHub Update Branch Protection
        call: repo-branches-protections.updatebranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletebranchprotection
        description: GitHub Delete Branch Protection
        call: repo-branches-protections.deletebranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
      name: repos-owner-repo-branches-branch-protection-enforce-admins
      description: REST surface for repos-owner-repo-branches-branch-protection-enforce_admins.
      operations:
      - method: GET
        name: getadminbranchprotection
        description: GitHub Get Admin Branch Protection
        call: repo-branches-protections.getadminbranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: setadminbranchprotection
        description: GitHub Set Admin Branch Protection
        call: repo-branches-protections.setadminbranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteadminbranchprotection
        description: GitHub Delete Admin Branch Protection
        call: repo-branches-protections.deleteadminbranchprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/branches/{branch}/protection/required-pull-request-reviews
      name: repos-owner-repo-branches-branch-protection-required-pull-request-reviews
      description: REST surface for repos-owner-repo-branches-branch-protection-required_pull_request_reviews.
      operations:
      - method: GET
        name: getpullrequestreviewprotection
        description: GitHub Get Pull Request Review Protection
        call: repo-branches-protections.getpullrequestreviewprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updatepullrequestreviewprotection
        description: GitHub Update Pull Request Review Protection
        call: repo-branches-protections.updatepullrequestreviewprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletepullrequestreviewprotection
        description: GitHub Delete Pull Request Review Protection
        call: repo-branches-protections.deletepullrequestreviewprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/branches/{branch}/protection/required-signatures
      name: repos-owner-repo-branches-branch-protection-required-signatures
      description: REST surface for repos-owner-repo-branches-branch-protection-required_signatures.
      operations:
      - method: GET
        name: getcommitsignatureprotection
        description: GitHub Get Commit Signature Protection
        call: repo-branches-protections.getcommitsignatureprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createcommitsignatureprotection
        description: GitHub Create Commit Signature Protection
        call: repo-branches-protections.createcommitsignatureprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletecommitsignatureprotection
        description: GitHub Delete Commit Signature Protection
        call: repo-branches-protections.deletecommitsignatureprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/branches/{branch}/protection/required-status-checks
      name: repos-owner-repo-branches-branch-protection-required-status-checks
      description: REST surface for repos-owner-repo-branches-branch-protection-required_status_checks.
      operations:
      - method: GET
        name: getstatuschecksprotection
        description: GitHub Get Status Checks Protection
        call: repo-branches-protections.getstatuschecksprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updatestatuscheckprotection
        description: GitHub Update Status Check Protection
        call: repo-branches-protections.updatestatuscheckprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: removestatuscheckprotection
        description: GitHub Remove Status Check Protection
        call: repo-branches-protections.removestatuscheckprotection
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: repo-branches-protections-mcp
    port: 9090
    transport: http
    description: MCP adapter for github-repos-api — Protections. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: github-get-branch-protection
      description: GitHub Get Branch Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-branches-protections.getbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-update-branch-protection
      description: GitHub Update Branch Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: repo-branches-protections.updatebranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: github-delete-branch-protection
      description: GitHub Delete Branch Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-branches-protections.deletebranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-get-admin-branch-protection
      description: GitHub Get Admin Branch Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-branches-protections.getadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-set-admin-branch-protection
      description: GitHub Set Admin Branch Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repo-branches-protections.setadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-delete-admin-branch-protection
      description: GitHub Delete Admin Branch Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-branches-protections.deleteadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-get-pull-request-review
      description: GitHub Get Pull Request Review Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-branches-protections.getpullrequestreviewprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-update-pull-request-review
      description: GitHub Update Pull Request Review Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: repo-branches-protections.updatepullrequestreviewprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: github-delete-pull-request-review
      description: GitHub Delete Pull Request Review Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-branches-protections.deletepullrequestreviewprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-get-commit-signature-protection
      description: GitHub Get Commit Signature Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-branches-protections.getcommitsignatureprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-create-commit-signature-protection
      description: GitHub Create Commit Signature Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repo-branches-protections.createcommitsignatureprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-delete-commit-signature-protection
      description: GitHub Delete Commit Signature Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-branches-protections.deletecommitsignatureprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-get-status-checks-protection
      description: GitHub Get Status Checks Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-branches-protections.getstatuschecksprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-update-status-check-protection
      description: GitHub Update Status Check Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: repo-branches-protections.updatestatuscheckprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: github-remove-status-check-protection
      description: GitHub Remove Status Check Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-branches-protections.removestatuscheckprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.