Freestyle · Capability

Freestyle Git API — Branches

Freestyle Git API branches surface. 3 operations. Lead operation: List Branches in a Repo. Self-contained Naftiko capability for one Freestyle business surface.

Freestyle Git API — Branches is a Naftiko capability published by Freestyle, one of 30 capabilities the APIs.io network indexes for this provider. It bundles 3 operations across the GET and POST methods rooted at /v1/git/v1/repo/{…}/git/refs/heads.

The capability includes 2 read-only operations and 1 state-changing operation. Lead operation: List Branches in a Repo. Can be deployed as a REST endpoint, MCP tool, or Agent Skill via Naftiko.

Tagged areas include Freestyle, Git, and Branches.

Run with Naftiko FreestyleGitBranches

What You Can Do

GET
Handle list branches — List Branches in a Repo
/v1/git/v1/repo/{repo}/git/refs/heads/
POST
Handle create branch — Create a New Branch
/v1/git/v1/repo/{repo}/git/refs/heads/{*branch}
GET
Handle get ref branch — Get a Branch Reference
/v1/git/v1/repo/{repo}/git/refs/heads/{branch}

MCP Tools

freestyle-handle-list-branches

List Branches in a Repo

read-only idempotent
freestyle-handle-create-branch

Create a New Branch

freestyle-handle-get-ref-branch

Get a Branch Reference

read-only idempotent

Capability Spec

git-branches.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: "Freestyle Git API \u2014 Branches"
  description: 'Freestyle Git API branches surface. 3 operations. Lead operation: List Branches in a Repo. Self-contained
    Naftiko capability for one Freestyle business surface.'
  tags:
  - Freestyle
  - Git
  - Branches
  created: '2026-05-25'
  modified: '2026-05-25'
binds:
- namespace: env
  keys:
    FREESTYLE_API_KEY: FREESTYLE_API_KEY
capability:
  consumes:
  - type: http
    namespace: git-branches
    baseUri: https://api.freestyle.sh
    description: Freestyle Git API branches business capability.
    resources:
    - name: git-v1-repo-git-refs-heads
      path: /git/v1/repo/{repo}/git/refs/heads/
      operations:
      - name: handle-list-branches
        method: GET
        description: List Branches in a Repo
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: repo
          in: path
          type: string
          required: true
    - name: git-v1-repo-git-refs-heads
      path: /git/v1/repo/{repo}/git/refs/heads/{*branch}
      operations:
      - name: handle-create-branch
        method: POST
        description: Create a New Branch
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: repo
          in: path
          type: string
          required: true
        - name: branch
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: git-v1-repo-git-refs-heads
      path: /git/v1/repo/{repo}/git/refs/heads/{branch}
      operations:
      - name: handle-get-ref-branch
        method: GET
        description: Get a Branch Reference
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: repo
          in: path
          type: string
          required: true
        - name: branch
          in: path
          type: string
          required: true
    authentication:
      type: apikey
      key: Authorization
      value: Bearer {{env.FREESTYLE_API_KEY}}
      placement: header
  exposes:
  - type: rest
    namespace: git-branches-rest
    port: 8080
    description: REST adapter for Freestyle Git API branches. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/git/v1/repo/{repo}/git/refs/heads/
      name: git-v1-repo-git-refs-heads
      description: REST surface for git-v1-repo-git-refs-heads.
      operations:
      - method: GET
        name: handle-list-branches
        description: List Branches in a Repo
        call: git-branches.handle-list-branches
        with:
          repo: rest.path.repo
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/git/v1/repo/{repo}/git/refs/heads/{*branch}
      name: git-v1-repo-git-refs-heads
      description: REST surface for git-v1-repo-git-refs-heads.
      operations:
      - method: POST
        name: handle-create-branch
        description: Create a New Branch
        call: git-branches.handle-create-branch
        with:
          repo: rest.path.repo
          branch: rest.path.branch
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/git/v1/repo/{repo}/git/refs/heads/{branch}
      name: git-v1-repo-git-refs-heads
      description: REST surface for git-v1-repo-git-refs-heads.
      operations:
      - method: GET
        name: handle-get-ref-branch
        description: Get a Branch Reference
        call: git-branches.handle-get-ref-branch
        with:
          repo: rest.path.repo
          branch: rest.path.branch
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: git-branches-mcp
    port: 9090
    transport: http
    description: MCP adapter for Freestyle Git API branches. One tool per consumed operation.
    tools:
    - name: freestyle-handle-list-branches
      description: List Branches in a Repo
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: git-branches.handle-list-branches
      with:
        repo: tools.path.repo
      outputParameters:
      - type: object
        mapping: $.
    - name: freestyle-handle-create-branch
      description: Create a New Branch
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: git-branches.handle-create-branch
      with:
        repo: tools.path.repo
        branch: tools.path.branch
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: freestyle-handle-get-ref-branch
      description: Get a Branch Reference
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: git-branches.handle-get-ref-branch
      with:
        repo: tools.path.repo
        branch: tools.path.branch
      outputParameters:
      - type: object
        mapping: $.