GitHub · Capability

GitHub Repos API — Branches

GitHub Repos API — Branches. 21 operations. Lead operation: List Branches. Self-contained Naftiko capability covering one Github business surface.

Run with Naftiko GithubBranches

What You Can Do

GET
Listbranches — List Branches
/v1/repos/{owner}/{repo}/branches
GET
Getbranch — Get Branch
/v1/repos/{owner}/{repo}/branches/{branch}
GET
Getbranchprotection — Get Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
PUT
Updatebranchprotection — Update Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
DELETE
Deletebranchprotection — Delete Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection
GET
Getadminbranchprotection — Get Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
POST
Setadminbranchprotection — Set Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
DELETE
Deleteadminbranchprotection — Delete Admin Branch Protection
/v1/repos/{owner}/{repo}/branches/{branch}/protection/enforce-admins
GET
Getappswithaccesstotheprotectedbranch — Get Apps With Access To The Protected Branch
/v1/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps
GET
Getteamswithaccesstotheprotectedbranch — Get Teams With Access To The Protected Branch
/v1/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams
GET
Getuserswithaccesstotheprotectedbranch — Get Users With Access To The Protected Branch
/v1/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users
POST
Renamebranch — Rename Branch
/v1/repos/{owner}/{repo}/branches/{branch}/rename
GET
Listbranchesforheadcommit — List Branches For Head Commit
/v1/repos/{owner}/{repo}/commits/{commit-sha}/branches-where-head
GET
Listdeploymentbranchpolicies — List Deployment Branch Policies
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies
POST
Createdeploymentbranchpolicy — Create Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies
GET
Getdeploymentbranchpolicy — Get Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
PUT
Updatedeploymentbranchpolicy — Update Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
DELETE
Deletedeploymentbranchpolicy — Delete Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
POST
Syncforkbranchwiththeupstreamrepository — Sync Fork Branch With The Upstream Repository
/v1/repos/{owner}/{repo}/merge-upstream
POST
Mergebranch — Merge Branch
/v1/repos/{owner}/{repo}/merges
PUT
Updatepullrequestbranch — Update Pull Request Branch
/v1/repos/{owner}/{repo}/pulls/{pull-number}/update-branch

MCP Tools

list-branches

List Branches

read-only idempotent
get-branch

Get Branch

read-only idempotent
get-branch-protection

Get Branch Protection

read-only idempotent
update-branch-protection

Update Branch Protection

idempotent
delete-branch-protection

Delete Branch Protection

idempotent
get-admin-branch-protection

Get Admin Branch Protection

read-only idempotent
set-admin-branch-protection

Set Admin Branch Protection

delete-admin-branch-protection

Delete Admin Branch Protection

idempotent
get-apps-access-protected-branch

Get Apps With Access To The Protected Branch

read-only idempotent
get-teams-access-protected-branch

Get Teams With Access To The Protected Branch

read-only idempotent
get-users-access-protected-branch

Get Users With Access To The Protected Branch

read-only idempotent
rename-branch

Rename Branch

list-branches-head-commit

List Branches For Head Commit

read-only idempotent
list-deployment-branch-policies

List Deployment Branch Policies

read-only idempotent
create-deployment-branch-policy

Create Deployment Branch Policy

get-deployment-branch-policy

Get Deployment Branch Policy

read-only idempotent
update-deployment-branch-policy

Update Deployment Branch Policy

idempotent
delete-deployment-branch-policy

Delete Deployment Branch Policy

idempotent
sync-fork-branch-upstream-repository

Sync Fork Branch With The Upstream Repository

merge-branch

Merge Branch

update-pull-request-branch

Update Pull Request Branch

idempotent

Capability Spec

temp-branches.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: GitHub Repos API — Branches
  description: 'GitHub Repos API — Branches. 21 operations. Lead operation: List Branches. Self-contained Naftiko capability
    covering one Github business surface.'
  tags:
  - Github
  - Branches
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GITHUB_API_KEY: GITHUB_API_KEY
capability:
  consumes:
  - type: http
    namespace: temp-branches
    baseUri: ''
    description: GitHub Repos API — Branches business capability. Self-contained, no shared references.
    resources:
    - name: repos-owner-repo-branches
      path: /repos/{owner}/{repo}/branches
      operations:
      - name: listbranches
        method: GET
        description: List Branches
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: protected
          in: query
          type: boolean
          description: Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are
            returned. Omitting this parameter returns all branches.
        - 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
      path: /repos/{owner}/{repo}/branches/{branch}
      operations:
      - name: getbranch
        method: GET
        description: Get Branch
        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
      path: /repos/{owner}/{repo}/branches/{branch}/protection
      operations:
      - name: getbranchprotection
        method: GET
        description: 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: 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: 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: 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: 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: 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-restrictions-apps
      path: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps
      operations:
      - name: getappswithaccesstotheprotectedbranch
        method: GET
        description: Get Apps With Access To The Protected Branch
        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-restrictions-teams
      path: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams
      operations:
      - name: getteamswithaccesstotheprotectedbranch
        method: GET
        description: Get Teams With Access To The Protected Branch
        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-restrictions-users
      path: /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users
      operations:
      - name: getuserswithaccesstotheprotectedbranch
        method: GET
        description: Get Users With Access To The Protected Branch
        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-rename
      path: /repos/{owner}/{repo}/branches/{branch}/rename
      operations:
      - name: renamebranch
        method: POST
        description: Rename Branch
        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: repos-owner-repo-commits-commit_sha-branches-where-head
      path: /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head
      operations:
      - name: listbranchesforheadcommit
        method: GET
        description: List Branches For Head Commit
        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-environments-environment_name-deployment-branch-policies
      path: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies
      operations:
      - name: listdeploymentbranchpolicies
        method: GET
        description: List Deployment Branch Policies
        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: createdeploymentbranchpolicy
        method: POST
        description: Create Deployment Branch Policy
        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: repos-owner-repo-environments-environment_name-deployment-branch-policies-branch
      path: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
      operations:
      - name: getdeploymentbranchpolicy
        method: GET
        description: Get Deployment Branch Policy
        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: updatedeploymentbranchpolicy
        method: PUT
        description: Update Deployment Branch Policy
        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: deletedeploymentbranchpolicy
        method: DELETE
        description: Delete Deployment Branch Policy
        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-merge-upstream
      path: /repos/{owner}/{repo}/merge-upstream
      operations:
      - name: syncforkbranchwiththeupstreamrepository
        method: POST
        description: Sync Fork Branch With The Upstream Repository
        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: repos-owner-repo-merges
      path: /repos/{owner}/{repo}/merges
      operations:
      - name: mergebranch
        method: POST
        description: Merge Branch
        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: repos-owner-repo-pulls-pull_number-update-branch
      path: /repos/{owner}/{repo}/pulls/{pull_number}/update-branch
      operations:
      - name: updatepullrequestbranch
        method: PUT
        description: Update Pull Request Branch
        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
    authentication:
      type: bearer
      token: '{{env.GITHUB_API_KEY}}'
  exposes:
  - type: rest
    namespace: temp-branches-rest
    port: 8080
    description: REST adapter for GitHub Repos API — Branches. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/repos/{owner}/{repo}/branches
      name: repos-owner-repo-branches
      description: REST surface for repos-owner-repo-branches.
      operations:
      - method: GET
        name: listbranches
        description: List Branches
        call: temp-branches.listbranches
        with:
          protected: rest.protected
          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}
      name: repos-owner-repo-branches-branch
      description: REST surface for repos-owner-repo-branches-branch.
      operations:
      - method: GET
        name: getbranch
        description: Get Branch
        call: temp-branches.getbranch
        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
      name: repos-owner-repo-branches-branch-protection
      description: REST surface for repos-owner-repo-branches-branch-protection.
      operations:
      - method: GET
        name: getbranchprotection
        description: Get Branch Protection
        call: temp-branches.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: Update Branch Protection
        call: temp-branches.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: Delete Branch Protection
        call: temp-branches.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: Get Admin Branch Protection
        call: temp-branches.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: Set Admin Branch Protection
        call: temp-branches.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: Delete Admin Branch Protection
        call: temp-branches.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/restrictions/apps
      name: repos-owner-repo-branches-branch-protection-restrictions-apps
      description: REST surface for repos-owner-repo-branches-branch-protection-restrictions-apps.
      operations:
      - method: GET
        name: getappswithaccesstotheprotectedbranch
        description: Get Apps With Access To The Protected Branch
        call: temp-branches.getappswithaccesstotheprotectedbranch
        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/restrictions/teams
      name: repos-owner-repo-branches-branch-protection-restrictions-teams
      description: REST surface for repos-owner-repo-branches-branch-protection-restrictions-teams.
      operations:
      - method: GET
        name: getteamswithaccesstotheprotectedbranch
        description: Get Teams With Access To The Protected Branch
        call: temp-branches.getteamswithaccesstotheprotectedbranch
        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/restrictions/users
      name: repos-owner-repo-branches-branch-protection-restrictions-users
      description: REST surface for repos-owner-repo-branches-branch-protection-restrictions-users.
      operations:
      - method: GET
        name: getuserswithaccesstotheprotectedbranch
        description: Get Users With Access To The Protected Branch
        call: temp-branches.getuserswithaccesstotheprotectedbranch
        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}/rename
      name: repos-owner-repo-branches-branch-rename
      description: REST surface for repos-owner-repo-branches-branch-rename.
      operations:
      - method: POST
        name: renamebranch
        description: Rename Branch
        call: temp-branches.renamebranch
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/commits/{commit-sha}/branches-where-head
      name: repos-owner-repo-commits-commit-sha-branches-where-head
      description: REST surface for repos-owner-repo-commits-commit_sha-branches-where-head.
      operations:
      - method: GET
        name: listbranchesforheadcommit
        description: List Branches For Head Commit
        call: temp-branches.listbranchesforheadcommit
        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}/environments/{environment-name}/deployment-branch-policies
      name: repos-owner-repo-environments-environment-name-deployment-branch-policies
      description: REST surface for repos-owner-repo-environments-environment_name-deployment-branch-policies.
      operations:
      - method: GET
        name: listdeploymentbranchpolicies
        description: List Deployment Branch Policies
        call: temp-branches.listdeploymentbranchpolicies
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createdeploymentbranchpolicy
        description: Create Deployment Branch Policy
        call: temp-branches.createdeploymentbranchpolicy
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
      name: repos-owner-repo-environments-environment-name-deployment-branch-policies-branch
      description: REST surface for repos-owner-repo-environments-environment_name-deployment-branch-policies-branch.
      operations:
      - method: GET
        name: getdeploymentbranchpolicy
        description: Get Deployment Branch Policy
        call: temp-branches.getdeploymentbranchpolicy
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatedeploymentbranchpolicy
        description: Update Deployment Branch Policy
        call: temp-branches.updatedeploymentbranchpolicy
        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: deletedeploymentbranchpolicy
        description: Delete Deployment Branch Policy
        call: temp-branches.deletedeploymentbranchpolicy
        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}/merge-upstream
      name: repos-owner-repo-merge-upstream
      description: REST surface for repos-owner-repo-merge-upstream.
      operations:
      - method: POST
        name: syncforkbranchwiththeupstreamrepository
        description: Sync Fork Branch With The Upstream Repository
        call: temp-branches.syncforkbranchwiththeupstreamrepository
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/merges
      name: repos-owner-repo-merges
      description: REST surface for repos-owner-repo-merges.
      operations:
      - method: POST
        name: mergebranch
        description: Merge Branch
        call: temp-branches.mergebranch
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repos/{owner}/{repo}/pulls/{pull-number}/update-branch
      name: repos-owner-repo-pulls-pull-number-update-branch
      description: REST surface for repos-owner-repo-pulls-pull_number-update-branch.
      operations:
      - method: PUT
        name: updatepullrequestbranch
        description: Update Pull Request Branch
        call: temp-branches.updatepullrequestbranch
        with:
          Authorization: rest.Authorization
          X-GitHub-Api-Version: rest.X-GitHub-Api-Version
          Accept: rest.Accept
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: temp-branches-mcp
    port: 9090
    transport: http
    description: MCP adapter for GitHub Repos API — Branches. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: list-branches
      description: List Branches
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.listbranches
      with:
        protected: tools.protected
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-branch
      description: Get Branch
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getbranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-branch-protection
      description: Get Branch Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: update-branch-protection
      description: Update Branch Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: temp-branches.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: delete-branch-protection
      description: Delete Branch Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: temp-branches.deletebranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-admin-branch-protection
      description: Get Admin Branch Protection
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: set-admin-branch-protection
      description: Set Admin Branch Protection
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: temp-branches.setadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-admin-branch-protection
      description: Delete Admin Branch Protection
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: temp-branches.deleteadminbranchprotection
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-apps-access-protected-branch
      description: Get Apps With Access To The Protected Branch
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getappswithaccesstotheprotectedbranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-teams-access-protected-branch
      description: Get Teams With Access To The Protected Branch
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getteamswithaccesstotheprotectedbranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: get-users-access-protected-branch
      description: Get Users With Access To The Protected Branch
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.getuserswithaccesstotheprotectedbranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: rename-branch
      description: Rename Branch
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: temp-branches.renamebranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-branches-head-commit
      description: List Branches For Head Commit
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.listbranchesforheadcommit
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: list-deployment-branch-policies
      description: List Deployment Branch Policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: temp-branches.listdeploymentbranchpolicies
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: create-deployment-branch-policy
      description: Create Deployment Branch Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: temp-branches.createdeploymentbranchpolicy
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-deployment-branch-policy
      description: Get Deployment Branch Pol

# --- truncated at 32 KB (34 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/capabilities/temp-branches.yaml