GitHub · Capability

github-repos-api — Branches

github-repos-api — Branches. 8 operations. Lead operation: GitHub List Branches for Head Commit. Self-contained Naftiko capability covering one Github business surface.

Run with Naftiko GithubBranches

What You Can Do

GET
Listbranchesforheadcommit — GitHub List Branches for Head Commit
/v1/repos/{owner}/{repo}/commits/{commit-sha}/branches-where-head
GET
Listdeploymentbranchpolicies — GitHub List Deployment Branch Policies
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies
POST
Createdeploymentbranchpolicy — GitHub Create Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies
GET
Getdeploymentbranchpolicy — GitHub Get Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
PUT
Updatedeploymentbranchpolicy — GitHub Update Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
DELETE
Deletedeploymentbranchpolicy — GitHub Delete Deployment Branch Policy
/v1/repos/{owner}/{repo}/environments/{environment-name}/deployment-branch-policies/{branch-policy-id}
POST
Syncforkbranchwiththeupstreamrepository — GitHub Sync Fork Branch with the Upstream Repository
/v1/repos/{owner}/{repo}/merge-upstream
POST
Mergebranch — GitHub Merge Branch
/v1/repos/{owner}/{repo}/merges

MCP Tools

github-list-branches-head-commit

GitHub List Branches for Head Commit

read-only idempotent
github-list-deployment-branch-policies

GitHub List Deployment Branch Policies

read-only idempotent
github-create-deployment-branch-policy

GitHub Create Deployment Branch Policy

github-get-deployment-branch-policy

GitHub Get Deployment Branch Policy

read-only idempotent
github-update-deployment-branch-policy

GitHub Update Deployment Branch Policy

idempotent
github-delete-deployment-branch-policy

GitHub Delete Deployment Branch Policy

idempotent
github-sync-fork-branch-upstream

GitHub Sync Fork Branch with the Upstream Repository

github-merge-branch

GitHub Merge Branch

Capability Spec

repo-tags-branches.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: github-repos-api — Branches
  description: 'github-repos-api — Branches. 8 operations. Lead operation: GitHub List Branches for Head Commit. 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: repo-tags-branches
    baseUri: ''
    description: github-repos-api — Branches business capability. Self-contained, no shared references.
    resources:
    - 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: GitHub 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: GitHub 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: GitHub 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: GitHub 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: GitHub 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: GitHub 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: GitHub 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: GitHub 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
    authentication:
      type: bearer
      token: '{{env.GITHUB_API_KEY}}'
  exposes:
  - type: rest
    namespace: repo-tags-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}/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: GitHub List Branches for Head Commit
        call: repo-tags-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: GitHub List Deployment Branch Policies
        call: repo-tags-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: GitHub Create Deployment Branch Policy
        call: repo-tags-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: GitHub Get Deployment Branch Policy
        call: repo-tags-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: GitHub Update Deployment Branch Policy
        call: repo-tags-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: GitHub Delete Deployment Branch Policy
        call: repo-tags-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: GitHub Sync Fork Branch with the Upstream Repository
        call: repo-tags-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: GitHub Merge Branch
        call: repo-tags-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: $.
  - type: mcp
    namespace: repo-tags-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: github-list-branches-head-commit
      description: GitHub List Branches for Head Commit
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-tags-branches.listbranchesforheadcommit
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-list-deployment-branch-policies
      description: GitHub List Deployment Branch Policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-tags-branches.listdeploymentbranchpolicies
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-create-deployment-branch-policy
      description: GitHub Create Deployment Branch Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repo-tags-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: github-get-deployment-branch-policy
      description: GitHub Get Deployment Branch Policy
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repo-tags-branches.getdeploymentbranchpolicy
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-update-deployment-branch-policy
      description: GitHub Update Deployment Branch Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: repo-tags-branches.updatedeploymentbranchpolicy
      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-deployment-branch-policy
      description: GitHub Delete Deployment Branch Policy
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repo-tags-branches.deletedeploymentbranchpolicy
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
      outputParameters:
      - type: object
        mapping: $.
    - name: github-sync-fork-branch-upstream
      description: GitHub Sync Fork Branch with the Upstream Repository
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repo-tags-branches.syncforkbranchwiththeupstreamrepository
      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-merge-branch
      description: GitHub Merge Branch
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repo-tags-branches.mergebranch
      with:
        Authorization: tools.Authorization
        X-GitHub-Api-Version: tools.X-GitHub-Api-Version
        Accept: tools.Accept
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.