naftiko: 1.0.0-alpha2 info: label: Bitbucket API — Refs description: 'Bitbucket API — Refs. 9 operations. Lead operation: List branches and tags. Self-contained Naftiko capability covering one Bitbucket Pipelines business surface.' tags: - Bitbucket Pipelines - Refs created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: BITBUCKET_PIPELINES_API_KEY: BITBUCKET_PIPELINES_API_KEY capability: consumes: - type: http namespace: bitbucket-pipelines-refs baseUri: https://api.bitbucket.org/2.0 description: Bitbucket API — Refs business capability. Self-contained, no shared references. resources: - name: repositories-workspace-repo_slug-refs path: /repositories/{workspace}/{repo_slug}/refs operations: - name: get method: GET description: List branches and tags outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: q in: query type: string description: Query string to narrow down the response as per - name: sort in: query type: string description: Field by which the results should be sorted as per - name: repositories-workspace-repo_slug-refs-branches path: /repositories/{workspace}/{repo_slug}/refs/branches operations: - name: get method: GET description: List open branches outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: q in: query type: string description: Query string to narrow down the response as per - name: sort in: query type: string description: Field by which the results should be sorted as per - name: post method: POST description: Create a branch outputRawFormat: json outputParameters: - name: result type: object value: $. - name: repositories-workspace-repo_slug-refs-branches-name path: /repositories/{workspace}/{repo_slug}/refs/branches/{name} operations: - name: delete method: DELETE description: Delete a branch outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Get a branch outputRawFormat: json outputParameters: - name: result type: object value: $. - name: repositories-workspace-repo_slug-refs-tags path: /repositories/{workspace}/{repo_slug}/refs/tags operations: - name: get method: GET description: List tags outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: q in: query type: string description: Query string to narrow down the response as per - name: sort in: query type: string description: Field by which the results should be sorted as per - name: post method: POST description: Create a tag outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _body in: body type: string required: true - name: repositories-workspace-repo_slug-refs-tags-name path: /repositories/{workspace}/{repo_slug}/refs/tags/{name} operations: - name: delete method: DELETE description: Delete a tag outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Get a tag outputRawFormat: json outputParameters: - name: result type: object value: $. exposes: - type: rest namespace: bitbucket-pipelines-refs-rest port: 8080 description: REST adapter for Bitbucket API — Refs. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/repositories/{workspace}/{repo-slug}/refs name: repositories-workspace-repo-slug-refs description: REST surface for repositories-workspace-repo_slug-refs. operations: - method: GET name: get description: List branches and tags call: bitbucket-pipelines-refs.get with: q: rest.q sort: rest.sort outputParameters: - type: object mapping: $. - path: /v1/repositories/{workspace}/{repo-slug}/refs/branches name: repositories-workspace-repo-slug-refs-branches description: REST surface for repositories-workspace-repo_slug-refs-branches. operations: - method: GET name: get description: List open branches call: bitbucket-pipelines-refs.get with: q: rest.q sort: rest.sort outputParameters: - type: object mapping: $. - method: POST name: post description: Create a branch call: bitbucket-pipelines-refs.post outputParameters: - type: object mapping: $. - path: /v1/repositories/{workspace}/{repo-slug}/refs/branches/{name} name: repositories-workspace-repo-slug-refs-branches-name description: REST surface for repositories-workspace-repo_slug-refs-branches-name. operations: - method: DELETE name: delete description: Delete a branch call: bitbucket-pipelines-refs.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Get a branch call: bitbucket-pipelines-refs.get outputParameters: - type: object mapping: $. - path: /v1/repositories/{workspace}/{repo-slug}/refs/tags name: repositories-workspace-repo-slug-refs-tags description: REST surface for repositories-workspace-repo_slug-refs-tags. operations: - method: GET name: get description: List tags call: bitbucket-pipelines-refs.get with: q: rest.q sort: rest.sort outputParameters: - type: object mapping: $. - method: POST name: post description: Create a tag call: bitbucket-pipelines-refs.post with: _body: rest._body outputParameters: - type: object mapping: $. - path: /v1/repositories/{workspace}/{repo-slug}/refs/tags/{name} name: repositories-workspace-repo-slug-refs-tags-name description: REST surface for repositories-workspace-repo_slug-refs-tags-name. operations: - method: DELETE name: delete description: Delete a tag call: bitbucket-pipelines-refs.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Get a tag call: bitbucket-pipelines-refs.get outputParameters: - type: object mapping: $. - type: mcp namespace: bitbucket-pipelines-refs-mcp port: 9090 transport: http description: MCP adapter for Bitbucket API — Refs. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: list-branches-and-tags description: List branches and tags hints: readOnly: true destructive: false idempotent: true call: bitbucket-pipelines-refs.get with: q: tools.q sort: tools.sort outputParameters: - type: object mapping: $. - name: list-open-branches description: List open branches hints: readOnly: true destructive: false idempotent: true call: bitbucket-pipelines-refs.get with: q: tools.q sort: tools.sort outputParameters: - type: object mapping: $. - name: create-branch description: Create a branch hints: readOnly: false destructive: false idempotent: false call: bitbucket-pipelines-refs.post outputParameters: - type: object mapping: $. - name: delete-branch description: Delete a branch hints: readOnly: false destructive: true idempotent: true call: bitbucket-pipelines-refs.delete outputParameters: - type: object mapping: $. - name: get-branch description: Get a branch hints: readOnly: true destructive: false idempotent: true call: bitbucket-pipelines-refs.get outputParameters: - type: object mapping: $. - name: list-tags description: List tags hints: readOnly: true destructive: false idempotent: true call: bitbucket-pipelines-refs.get with: q: tools.q sort: tools.sort outputParameters: - type: object mapping: $. - name: create-tag description: Create a tag hints: readOnly: false destructive: false idempotent: false call: bitbucket-pipelines-refs.post with: _body: tools._body outputParameters: - type: object mapping: $. - name: delete-tag description: Delete a tag hints: readOnly: false destructive: true idempotent: true call: bitbucket-pipelines-refs.delete outputParameters: - type: object mapping: $. - name: get-tag description: Get a tag hints: readOnly: true destructive: false idempotent: true call: bitbucket-pipelines-refs.get outputParameters: - type: object mapping: $.