Bitbucket · Capability

Bitbucket API — Source

Bitbucket API — Source. 4 operations. Lead operation: List commits that modified a file. Self-contained Naftiko capability covering one Bitbucket business surface.

Run with Naftiko BitbucketSource

What You Can Do

GET
Get — List commits that modified a file
/v1/repositories/{workspace}/{repo-slug}/filehistory/{commit}/{path}
GET
Get — Get the root directory of the main branch
/v1/repositories/{workspace}/{repo-slug}/src
POST
Post — Create a commit by uploading a file
/v1/repositories/{workspace}/{repo-slug}/src
GET
Get — Get file or directory contents
/v1/repositories/{workspace}/{repo-slug}/src/{commit}/{path}

MCP Tools

list-commits-that-modified-file

List commits that modified a file

read-only idempotent
get-root-directory-main-branch

Get the root directory of the main branch

read-only idempotent
create-commit-uploading-file

Create a commit by uploading a file

get-file-directory-contents

Get file or directory contents

read-only idempotent

Capability Spec

cloud-rest-source.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Bitbucket API — Source
  description: 'Bitbucket API — Source. 4 operations. Lead operation: List commits that modified a file. Self-contained Naftiko
    capability covering one Bitbucket business surface.'
  tags:
  - Bitbucket
  - Source
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    BITBUCKET_API_KEY: BITBUCKET_API_KEY
capability:
  consumes:
  - type: http
    namespace: cloud-rest-source
    baseUri: https://api.bitbucket.org/2.0
    description: Bitbucket API — Source business capability. Self-contained, no shared references.
    resources:
    - name: repositories-workspace-repo_slug-filehistory-commit-path
      path: /repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}
      operations:
      - name: get
        method: GET
        description: List commits that modified a file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: renames
          in: query
          type: string
          description: When `true`, Bitbucket will follow the history of the file across
        - name: q
          in: query
          type: string
          description: Query string to narrow down the response as per
        - name: sort
          in: query
          type: string
          description: Name of a response property sort the result by as per
    - name: repositories-workspace-repo_slug-src
      path: /repositories/{workspace}/{repo_slug}/src
      operations:
      - name: get
        method: GET
        description: Get the root directory of the main branch
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
          description: Instead of returning the file's contents, return the (json) meta data for it.
      - name: post
        method: POST
        description: Create a commit by uploading a file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: message
          in: query
          type: string
          description: The commit message. When omitted, Bitbucket uses a canned string.
        - name: author
          in: query
          type: string
          description: The raw string to be used as the new commit's author.
        - name: parents
          in: query
          type: string
          description: '#### Deprecation Notice:'
        - name: files
          in: query
          type: string
          description: Optional field that declares the files that the request is
        - name: branch
          in: query
          type: string
          description: The name of the branch that the new commit should be
    - name: repositories-workspace-repo_slug-src-commit-path
      path: /repositories/{workspace}/{repo_slug}/src/{commit}/{path}
      operations:
      - name: get
        method: GET
        description: Get file or directory contents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
          description: If 'meta' is provided, returns the (json) meta data for the contents of the file.  If 'rendered' is
            provided, returns the contents of a non-binary file in HTML-
        - name: q
          in: query
          type: string
          description: Optional filter expression as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
        - name: sort
          in: query
          type: string
          description: Optional sorting parameter as per [filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results).
        - name: max_depth
          in: query
          type: integer
          description: If provided, returns the contents of the repository and its subdirectories recursively until the specified
            max_depth of nested directories. When omitted, this d
  exposes:
  - type: rest
    namespace: cloud-rest-source-rest
    port: 8080
    description: REST adapter for Bitbucket API — Source. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/repositories/{workspace}/{repo-slug}/filehistory/{commit}/{path}
      name: repositories-workspace-repo-slug-filehistory-commit-path
      description: REST surface for repositories-workspace-repo_slug-filehistory-commit-path.
      operations:
      - method: GET
        name: get
        description: List commits that modified a file
        call: cloud-rest-source.get
        with:
          renames: rest.renames
          q: rest.q
          sort: rest.sort
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/src
      name: repositories-workspace-repo-slug-src
      description: REST surface for repositories-workspace-repo_slug-src.
      operations:
      - method: GET
        name: get
        description: Get the root directory of the main branch
        call: cloud-rest-source.get
        with:
          format: rest.format
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a commit by uploading a file
        call: cloud-rest-source.post
        with:
          message: rest.message
          author: rest.author
          parents: rest.parents
          files: rest.files
          branch: rest.branch
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/src/{commit}/{path}
      name: repositories-workspace-repo-slug-src-commit-path
      description: REST surface for repositories-workspace-repo_slug-src-commit-path.
      operations:
      - method: GET
        name: get
        description: Get file or directory contents
        call: cloud-rest-source.get
        with:
          format: rest.format
          q: rest.q
          sort: rest.sort
          max_depth: rest.max_depth
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: cloud-rest-source-mcp
    port: 9090
    transport: http
    description: MCP adapter for Bitbucket API — Source. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-commits-that-modified-file
      description: List commits that modified a file
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cloud-rest-source.get
      with:
        renames: tools.renames
        q: tools.q
        sort: tools.sort
      outputParameters:
      - type: object
        mapping: $.
    - name: get-root-directory-main-branch
      description: Get the root directory of the main branch
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cloud-rest-source.get
      with:
        format: tools.format
      outputParameters:
      - type: object
        mapping: $.
    - name: create-commit-uploading-file
      description: Create a commit by uploading a file
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: cloud-rest-source.post
      with:
        message: tools.message
        author: tools.author
        parents: tools.parents
        files: tools.files
        branch: tools.branch
      outputParameters:
      - type: object
        mapping: $.
    - name: get-file-directory-contents
      description: Get file or directory contents
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cloud-rest-source.get
      with:
        format: tools.format
        q: tools.q
        sort: tools.sort
        max_depth: tools.max_depth
      outputParameters:
      - type: object
        mapping: $.