naftiko: 1.0.0-alpha2 info: label: Bitbucket API — Snippets description: 'Bitbucket API — Snippets. 25 operations. Lead operation: List snippets. Self-contained Naftiko capability covering one Bitbucket business surface.' tags: - Bitbucket - Snippets 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-snippets baseUri: https://api.bitbucket.org/2.0 description: Bitbucket API — Snippets business capability. Self-contained, no shared references. resources: - name: snippets path: /snippets operations: - name: get method: GET description: List snippets outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: role in: query type: string description: Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`). - name: post method: POST description: Create a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _body in: body type: string description: The new snippet object. required: true - name: snippets-workspace path: /snippets/{workspace} operations: - name: get method: GET description: List snippets in a workspace outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: role in: query type: string description: Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`). - name: post method: POST description: Create a snippet for a workspace outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _body in: body type: string description: The new snippet object. required: true - name: snippets-workspace-encoded_id path: /snippets/{workspace}/{encoded_id} operations: - name: delete method: DELETE description: Delete a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Get a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: put method: PUT description: Update a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-comments path: /snippets/{workspace}/{encoded_id}/comments operations: - name: get method: GET description: List comments on a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: post method: POST description: Create a comment on a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _body in: body type: string description: The contents of the new comment. required: true - name: snippets-workspace-encoded_id-comments-comment_id path: /snippets/{workspace}/{encoded_id}/comments/{comment_id} operations: - name: delete method: DELETE description: Delete a comment on a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Get a comment on a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: put method: PUT description: Update a comment on a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _body in: body type: string description: The contents to update the comment to. required: true - name: snippets-workspace-encoded_id-commits path: /snippets/{workspace}/{encoded_id}/commits operations: - name: get method: GET description: List snippet changes outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-commits-revision path: /snippets/{workspace}/{encoded_id}/commits/{revision} operations: - name: get method: GET description: Get a previous snippet change outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-files-path path: /snippets/{workspace}/{encoded_id}/files/{path} operations: - name: get method: GET description: Get a snippet's raw file at HEAD outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-watch path: /snippets/{workspace}/{encoded_id}/watch operations: - name: delete method: DELETE description: Stop watching a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Check if the current user is watching a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: put method: PUT description: Watch a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-watchers path: /snippets/{workspace}/{encoded_id}/watchers operations: - name: get method: GET description: List users watching a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-node_id path: /snippets/{workspace}/{encoded_id}/{node_id} operations: - name: delete method: DELETE description: Delete a previous revision of a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: get method: GET description: Get a previous revision of a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: put method: PUT description: Update a previous revision of a snippet outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-node_id-files-path path: /snippets/{workspace}/{encoded_id}/{node_id}/files/{path} operations: - name: get method: GET description: Get a snippet's raw file outputRawFormat: json outputParameters: - name: result type: object value: $. - name: snippets-workspace-encoded_id-revision-diff path: /snippets/{workspace}/{encoded_id}/{revision}/diff operations: - name: get method: GET description: Get snippet changes between versions outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: path in: query type: string description: When used, only one the diff of the specified file will be returned. - name: snippets-workspace-encoded_id-revision-patch path: /snippets/{workspace}/{encoded_id}/{revision}/patch operations: - name: get method: GET description: Get snippet patch between versions outputRawFormat: json outputParameters: - name: result type: object value: $. exposes: - type: rest namespace: cloud-rest-snippets-rest port: 8080 description: REST adapter for Bitbucket API — Snippets. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/snippets name: snippets description: REST surface for snippets. operations: - method: GET name: get description: List snippets call: cloud-rest-snippets.get with: role: rest.role outputParameters: - type: object mapping: $. - method: POST name: post description: Create a snippet call: cloud-rest-snippets.post with: _body: rest._body outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace} name: snippets-workspace description: REST surface for snippets-workspace. operations: - method: GET name: get description: List snippets in a workspace call: cloud-rest-snippets.get with: role: rest.role outputParameters: - type: object mapping: $. - method: POST name: post description: Create a snippet for a workspace call: cloud-rest-snippets.post with: _body: rest._body outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id} name: snippets-workspace-encoded-id description: REST surface for snippets-workspace-encoded_id. operations: - method: DELETE name: delete description: Delete a snippet call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Get a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - method: PUT name: put description: Update a snippet call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/comments name: snippets-workspace-encoded-id-comments description: REST surface for snippets-workspace-encoded_id-comments. operations: - method: GET name: get description: List comments on a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - method: POST name: post description: Create a comment on a snippet call: cloud-rest-snippets.post with: _body: rest._body outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/comments/{comment-id} name: snippets-workspace-encoded-id-comments-comment-id description: REST surface for snippets-workspace-encoded_id-comments-comment_id. operations: - method: DELETE name: delete description: Delete a comment on a snippet call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Get a comment on a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - method: PUT name: put description: Update a comment on a snippet call: cloud-rest-snippets.put with: _body: rest._body outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/commits name: snippets-workspace-encoded-id-commits description: REST surface for snippets-workspace-encoded_id-commits. operations: - method: GET name: get description: List snippet changes call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/commits/{revision} name: snippets-workspace-encoded-id-commits-revision description: REST surface for snippets-workspace-encoded_id-commits-revision. operations: - method: GET name: get description: Get a previous snippet change call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/files/{path} name: snippets-workspace-encoded-id-files-path description: REST surface for snippets-workspace-encoded_id-files-path. operations: - method: GET name: get description: Get a snippet's raw file at HEAD call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/watch name: snippets-workspace-encoded-id-watch description: REST surface for snippets-workspace-encoded_id-watch. operations: - method: DELETE name: delete description: Stop watching a snippet call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Check if the current user is watching a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - method: PUT name: put description: Watch a snippet call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/watchers name: snippets-workspace-encoded-id-watchers description: REST surface for snippets-workspace-encoded_id-watchers. operations: - method: GET name: get description: List users watching a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/{node-id} name: snippets-workspace-encoded-id-node-id description: REST surface for snippets-workspace-encoded_id-node_id. operations: - method: DELETE name: delete description: Delete a previous revision of a snippet call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - method: GET name: get description: Get a previous revision of a snippet call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - method: PUT name: put description: Update a previous revision of a snippet call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/{node-id}/files/{path} name: snippets-workspace-encoded-id-node-id-files-path description: REST surface for snippets-workspace-encoded_id-node_id-files-path. operations: - method: GET name: get description: Get a snippet's raw file call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/{revision}/diff name: snippets-workspace-encoded-id-revision-diff description: REST surface for snippets-workspace-encoded_id-revision-diff. operations: - method: GET name: get description: Get snippet changes between versions call: cloud-rest-snippets.get with: path: rest.path outputParameters: - type: object mapping: $. - path: /v1/snippets/{workspace}/{encoded-id}/{revision}/patch name: snippets-workspace-encoded-id-revision-patch description: REST surface for snippets-workspace-encoded_id-revision-patch. operations: - method: GET name: get description: Get snippet patch between versions call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - type: mcp namespace: cloud-rest-snippets-mcp port: 9090 transport: http description: MCP adapter for Bitbucket API — Snippets. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: list-snippets description: List snippets hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get with: role: tools.role outputParameters: - type: object mapping: $. - name: create-snippet description: Create a snippet hints: readOnly: false destructive: false idempotent: false call: cloud-rest-snippets.post with: _body: tools._body outputParameters: - type: object mapping: $. - name: list-snippets-workspace description: List snippets in a workspace hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get with: role: tools.role outputParameters: - type: object mapping: $. - name: create-snippet-workspace description: Create a snippet for a workspace hints: readOnly: false destructive: false idempotent: false call: cloud-rest-snippets.post with: _body: tools._body outputParameters: - type: object mapping: $. - name: delete-snippet description: Delete a snippet hints: readOnly: false destructive: true idempotent: true call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - name: get-snippet description: Get a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: update-snippet description: Update a snippet hints: readOnly: false destructive: false idempotent: true call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - name: list-comments-snippet description: List comments on a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: create-comment-snippet description: Create a comment on a snippet hints: readOnly: false destructive: false idempotent: false call: cloud-rest-snippets.post with: _body: tools._body outputParameters: - type: object mapping: $. - name: delete-comment-snippet description: Delete a comment on a snippet hints: readOnly: false destructive: true idempotent: true call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - name: get-comment-snippet description: Get a comment on a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: update-comment-snippet description: Update a comment on a snippet hints: readOnly: false destructive: false idempotent: true call: cloud-rest-snippets.put with: _body: tools._body outputParameters: - type: object mapping: $. - name: list-snippet-changes description: List snippet changes hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: get-previous-snippet-change description: Get a previous snippet change hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: get-snippet-s-raw-file-head description: Get a snippet's raw file at HEAD hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: stop-watching-snippet description: Stop watching a snippet hints: readOnly: false destructive: true idempotent: true call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - name: check-if-current-user-is description: Check if the current user is watching a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: watch-snippet description: Watch a snippet hints: readOnly: false destructive: false idempotent: true call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - name: list-users-watching-snippet description: List users watching a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: delete-previous-revision-snippet description: Delete a previous revision of a snippet hints: readOnly: false destructive: true idempotent: true call: cloud-rest-snippets.delete outputParameters: - type: object mapping: $. - name: get-previous-revision-snippet description: Get a previous revision of a snippet hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: update-previous-revision-snippet description: Update a previous revision of a snippet hints: readOnly: false destructive: false idempotent: true call: cloud-rest-snippets.put outputParameters: - type: object mapping: $. - name: get-snippet-s-raw-file description: Get a snippet's raw file hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $. - name: get-snippet-changes-between-versions description: Get snippet changes between versions hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get with: path: tools.path outputParameters: - type: object mapping: $. - name: get-snippet-patch-between-versions description: Get snippet patch between versions hints: readOnly: true destructive: false idempotent: true call: cloud-rest-snippets.get outputParameters: - type: object mapping: $.