Bitbucket · Capability

Bitbucket API — Pullrequests

Bitbucket API — Pullrequests. 37 operations. Lead operation: List pull requests that contain a commit. Self-contained Naftiko capability covering one Bitbucket business surface.

Run with Naftiko BitbucketPullrequests

What You Can Do

GET
Getpullrequestsforcommit — List pull requests that contain a commit
/v1/repositories/{workspace}/{repo-slug}/commit/{commit}/pullrequests
GET
Get — List default reviewers
/v1/repositories/{workspace}/{repo-slug}/default-reviewers
DELETE
Delete — Remove a user from the default reviewers
/v1/repositories/{workspace}/{repo-slug}/default-reviewers/{target-username}
GET
Get — Get a default reviewer
/v1/repositories/{workspace}/{repo-slug}/default-reviewers/{target-username}
PUT
Put — Add a user to the default reviewers
/v1/repositories/{workspace}/{repo-slug}/default-reviewers/{target-username}
GET
Get — List effective default reviewers
/v1/repositories/{workspace}/{repo-slug}/effective-default-reviewers
GET
Get — List pull requests
/v1/repositories/{workspace}/{repo-slug}/pullrequests
POST
Post — Create a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests
GET
Get — List a pull request activity log
/v1/repositories/{workspace}/{repo-slug}/pullrequests/activity
GET
Get — Get a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}
PUT
Put — Update a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}
GET
Get — List a pull request activity log
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/activity
DELETE
Delete — Unapprove a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/approve
POST
Post — Approve a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/approve
GET
Get — List comments on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments
POST
Post — Create a comment on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments
DELETE
Delete — Delete a comment on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}
GET
Get — Get a comment on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}
PUT
Put — Update a comment on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}
DELETE
Delete — Reopen a comment thread
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}/resolve
POST
Post — Resolve a comment thread
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}/resolve
GET
Get — List commits on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/commits
POST
Post — Decline a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/decline
GET
Get — List changes in a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/diff
GET
Get — Get the diff stat for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/diffstat
POST
Post — Merge a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/merge
GET
Get — Get the merge task status for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/merge/task-status/{task-id}
GET
Get — Get the patch for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/patch
DELETE
Delete — Remove change request for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/request-changes
POST
Post — Request changes for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/request-changes
GET
Get — List commit statuses for a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/statuses
GET
Get — List tasks on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks
POST
Post — Create a task on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks
DELETE
Delete — Delete a task on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks/{task-id}
GET
Get — Get a task on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks/{task-id}
PUT
Put — Update a task on a pull request
/v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks/{task-id}
GET
Get — List workspace pull requests for a user
/v1/workspaces/{workspace}/pullrequests/{selected-user}

MCP Tools

list-pull-requests-that-contain

List pull requests that contain a commit

read-only idempotent
list-default-reviewers

List default reviewers

read-only idempotent
remove-user-default-reviewers

Remove a user from the default reviewers

idempotent
get-default-reviewer

Get a default reviewer

read-only idempotent
add-user-default-reviewers

Add a user to the default reviewers

idempotent
list-effective-default-reviewers

List effective default reviewers

read-only idempotent
list-pull-requests

List pull requests

read-only idempotent
create-pull-request

Create a pull request

list-pull-request-activity-log

List a pull request activity log

read-only idempotent
get-pull-request

Get a pull request

read-only idempotent
update-pull-request

Update a pull request

idempotent
list-pull-request-activity-log-2

List a pull request activity log

read-only idempotent
unapprove-pull-request

Unapprove a pull request

idempotent
approve-pull-request

Approve a pull request

list-comments-pull-request

List comments on a pull request

read-only idempotent
create-comment-pull-request

Create a comment on a pull request

delete-comment-pull-request

Delete a comment on a pull request

idempotent
get-comment-pull-request

Get a comment on a pull request

read-only idempotent
update-comment-pull-request

Update a comment on a pull request

idempotent
reopen-comment-thread

Reopen a comment thread

idempotent
resolve-comment-thread

Resolve a comment thread

list-commits-pull-request

List commits on a pull request

read-only idempotent
decline-pull-request

Decline a pull request

list-changes-pull-request

List changes in a pull request

read-only idempotent
get-diff-stat-pull-request

Get the diff stat for a pull request

read-only idempotent
merge-pull-request

Merge a pull request

get-merge-task-status-pull

Get the merge task status for a pull request

read-only idempotent
get-patch-pull-request

Get the patch for a pull request

read-only idempotent
remove-change-request-pull-request

Remove change request for a pull request

idempotent
request-changes-pull-request

Request changes for a pull request

list-commit-statuses-pull-request

List commit statuses for a pull request

read-only idempotent
list-tasks-pull-request

List tasks on a pull request

read-only idempotent
create-task-pull-request

Create a task on a pull request

delete-task-pull-request

Delete a task on a pull request

idempotent
get-task-pull-request

Get a task on a pull request

read-only idempotent
update-task-pull-request

Update a task on a pull request

idempotent
list-workspace-pull-requests-user

List workspace pull requests for a user

read-only idempotent

Capability Spec

cloud-rest-pullrequests.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Bitbucket API — Pullrequests
  description: 'Bitbucket API — Pullrequests. 37 operations. Lead operation: List pull requests that contain a commit. Self-contained
    Naftiko capability covering one Bitbucket business surface.'
  tags:
  - Bitbucket
  - Pullrequests
  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-pullrequests
    baseUri: https://api.bitbucket.org/2.0
    description: Bitbucket API — Pullrequests business capability. Self-contained, no shared references.
    resources:
    - name: repositories-workspace-repo_slug-commit-commit-pullrequests
      path: /repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests
      operations:
      - name: getpullrequestsforcommit
        method: GET
        description: List pull requests that contain a commit
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace
          in: path
          type: string
          description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces
          required: true
        - name: repo_slug
          in: path
          type: string
          description: The repository; either the UUID in curly braces, or the slug
          required: true
        - name: commit
          in: path
          type: string
          description: The SHA1 of the commit
          required: true
        - name: page
          in: query
          type: integer
          description: Which page to retrieve
        - name: pagelen
          in: query
          type: integer
          description: How many pull requests to retrieve per page
    - name: repositories-workspace-repo_slug-default-reviewers
      path: /repositories/{workspace}/{repo_slug}/default-reviewers
      operations:
      - name: get
        method: GET
        description: List default reviewers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-default-reviewers-target_username
      path: /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}
      operations:
      - name: delete
        method: DELETE
        description: Remove a user from the default reviewers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: get
        method: GET
        description: Get a default reviewer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put
        method: PUT
        description: Add a user to the default reviewers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-effective-default-reviewers
      path: /repositories/{workspace}/{repo_slug}/effective-default-reviewers
      operations:
      - name: get
        method: GET
        description: List effective default reviewers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests
      path: /repositories/{workspace}/{repo_slug}/pullrequests
      operations:
      - name: get
        method: GET
        description: List pull requests
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: state
          in: query
          type: string
          description: Only return pull requests that are in this state. This parameter can be repeated.
      - name: post
        method: POST
        description: Create a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The new pull request.
    - name: repositories-workspace-repo_slug-pullrequests-activity
      path: /repositories/{workspace}/{repo_slug}/pullrequests/activity
      operations:
      - name: get
        method: GET
        description: List a pull request activity log
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}
      operations:
      - name: get
        method: GET
        description: Get a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put
        method: PUT
        description: Update a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The pull request that is to be updated.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-activity
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity
      operations:
      - name: get
        method: GET
        description: List a pull request activity log
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-approve
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve
      operations:
      - name: delete
        method: DELETE
        description: Unapprove a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Approve a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-comments
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments
      operations:
      - name: get
        method: GET
        description: List comments on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Create a comment on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The comment object.
          required: true
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-comments-comment_i
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
      operations:
      - name: delete
        method: DELETE
        description: Delete a comment on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: get
        method: GET
        description: Get a comment on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put
        method: PUT
        description: Update a comment on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The contents of the updated comment.
          required: true
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-comments-comment_i
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve
      operations:
      - name: delete
        method: DELETE
        description: Reopen a comment thread
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Resolve a comment thread
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-commits
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits
      operations:
      - name: get
        method: GET
        description: List commits on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-decline
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline
      operations:
      - name: post
        method: POST
        description: Decline a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-diff
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff
      operations:
      - name: get
        method: GET
        description: List changes in a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-diffstat
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat
      operations:
      - name: get
        method: GET
        description: Get the diff stat for a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-merge
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge
      operations:
      - name: post
        method: POST
        description: Merge a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
        - name: async
          in: query
          type: boolean
          description: Default value is false.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-merge-task-status-
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}
      operations:
      - name: get
        method: GET
        description: Get the merge task status for a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-patch
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch
      operations:
      - name: get
        method: GET
        description: Get the patch for a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-request-changes
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes
      operations:
      - name: delete
        method: DELETE
        description: Remove change request for a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Request changes for a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-statuses
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses
      operations:
      - name: get
        method: GET
        description: List commit statuses for a pull request
        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-pullrequests-pull_request_id-tasks
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks
      operations:
      - name: get
        method: GET
        description: List tasks on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: q
          in: query
          type: string
          description: Query string to narrow down the response. See
        - name: sort
          in: query
          type: string
          description: Field by which the results should be sorted as per
        - name: pagelen
          in: query
          type: integer
          description: Current number of objects on the existing page.
      - name: post
        method: POST
        description: Create a task on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The contents of the task
          required: true
    - name: repositories-workspace-repo_slug-pullrequests-pull_request_id-tasks-task_id
      path: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id}
      operations:
      - name: delete
        method: DELETE
        description: Delete a task on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: get
        method: GET
        description: Get a task on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put
        method: PUT
        description: Update a task on a pull request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: _body
          in: body
          type: string
          description: The updated state and content of the task.
          required: true
    - name: workspaces-workspace-pullrequests-selected_user
      path: /workspaces/{workspace}/pullrequests/{selected_user}
      operations:
      - name: get
        method: GET
        description: List workspace pull requests for a user
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: state
          in: query
          type: string
          description: Only return pull requests that are in this state. This parameter can be repeated.
  exposes:
  - type: rest
    namespace: cloud-rest-pullrequests-rest
    port: 8080
    description: REST adapter for Bitbucket API — Pullrequests. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/repositories/{workspace}/{repo-slug}/commit/{commit}/pullrequests
      name: repositories-workspace-repo-slug-commit-commit-pullrequests
      description: REST surface for repositories-workspace-repo_slug-commit-commit-pullrequests.
      operations:
      - method: GET
        name: getpullrequestsforcommit
        description: List pull requests that contain a commit
        call: cloud-rest-pullrequests.getpullrequestsforcommit
        with:
          workspace: rest.workspace
          repo_slug: rest.repo_slug
          commit: rest.commit
          page: rest.page
          pagelen: rest.pagelen
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/default-reviewers
      name: repositories-workspace-repo-slug-default-reviewers
      description: REST surface for repositories-workspace-repo_slug-default-reviewers.
      operations:
      - method: GET
        name: get
        description: List default reviewers
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/default-reviewers/{target-username}
      name: repositories-workspace-repo-slug-default-reviewers-target-username
      description: REST surface for repositories-workspace-repo_slug-default-reviewers-target_username.
      operations:
      - method: DELETE
        name: delete
        description: Remove a user from the default reviewers
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: get
        description: Get a default reviewer
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Add a user to the default reviewers
        call: cloud-rest-pullrequests.put
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/effective-default-reviewers
      name: repositories-workspace-repo-slug-effective-default-reviewers
      description: REST surface for repositories-workspace-repo_slug-effective-default-reviewers.
      operations:
      - method: GET
        name: get
        description: List effective default reviewers
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests
      name: repositories-workspace-repo-slug-pullrequests
      description: REST surface for repositories-workspace-repo_slug-pullrequests.
      operations:
      - method: GET
        name: get
        description: List pull requests
        call: cloud-rest-pullrequests.get
        with:
          state: rest.state
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a pull request
        call: cloud-rest-pullrequests.post
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/activity
      name: repositories-workspace-repo-slug-pullrequests-activity
      description: REST surface for repositories-workspace-repo_slug-pullrequests-activity.
      operations:
      - method: GET
        name: get
        description: List a pull request activity log
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id.
      operations:
      - method: GET
        name: get
        description: Get a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a pull request
        call: cloud-rest-pullrequests.put
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/activity
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-activity
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-activity.
      operations:
      - method: GET
        name: get
        description: List a pull request activity log
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/approve
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-approve
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-approve.
      operations:
      - method: DELETE
        name: delete
        description: Unapprove a pull request
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Approve a pull request
        call: cloud-rest-pullrequests.post
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-comments
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-comments.
      operations:
      - method: GET
        name: get
        description: List comments on a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a comment on a pull request
        call: cloud-rest-pullrequests.post
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-i
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-comments-comment_i.
      operations:
      - method: DELETE
        name: delete
        description: Delete a comment on a pull request
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: get
        description: Get a comment on a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a comment on a pull request
        call: cloud-rest-pullrequests.put
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/comments/{comment-id}/resolve
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-i
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-comments-comment_i.
      operations:
      - method: DELETE
        name: delete
        description: Reopen a comment thread
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Resolve a comment thread
        call: cloud-rest-pullrequests.post
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/commits
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-commits
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-commits.
      operations:
      - method: GET
        name: get
        description: List commits on a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/decline
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-decline
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-decline.
      operations:
      - method: POST
        name: post
        description: Decline a pull request
        call: cloud-rest-pullrequests.post
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/diff
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-diff
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-diff.
      operations:
      - method: GET
        name: get
        description: List changes in a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/diffstat
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-diffstat
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-diffstat.
      operations:
      - method: GET
        name: get
        description: Get the diff stat for a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/merge
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-merge
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-merge.
      operations:
      - method: POST
        name: post
        description: Merge a pull request
        call: cloud-rest-pullrequests.post
        with:
          _body: rest._body
          async: rest.async
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/merge/task-status/{task-id}
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-task-status
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-merge-task-status-.
      operations:
      - method: GET
        name: get
        description: Get the merge task status for a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/patch
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-patch
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-patch.
      operations:
      - method: GET
        name: get
        description: Get the patch for a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/request-changes
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-request-changes
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-request-changes.
      operations:
      - method: DELETE
        name: delete
        description: Remove change request for a pull request
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Request changes for a pull request
        call: cloud-rest-pullrequests.post
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/statuses
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-statuses
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-statuses.
      operations:
      - method: GET
        name: get
        description: List commit statuses for a pull request
        call: cloud-rest-pullrequests.get
        with:
          q: rest.q
          sort: rest.sort
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-tasks.
      operations:
      - method: GET
        name: get
        description: List tasks on a pull request
        call: cloud-rest-pullrequests.get
        with:
          q: rest.q
          sort: rest.sort
          pagelen: rest.pagelen
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a task on a pull request
        call: cloud-rest-pullrequests.post
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/repositories/{workspace}/{repo-slug}/pullrequests/{pull-request-id}/tasks/{task-id}
      name: repositories-workspace-repo-slug-pullrequests-pull-request-id-tasks-task-id
      description: REST surface for repositories-workspace-repo_slug-pullrequests-pull_request_id-tasks-task_id.
      operations:
      - method: DELETE
        name: delete
        description: Delete a task on a pull request
        call: cloud-rest-pullrequests.delete
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: get
        description: Get a task on a pull request
        call: cloud-rest-pullrequests.get
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a task on a pull request
        call: cloud-rest-pullrequests.put
        with:
          _body: rest._body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/workspaces/{workspace}/pullrequests/{selected-user}
      name: workspaces-workspace-pullrequests-selected-user
      description: REST surface for workspaces-workspace-pullrequests-selected_user.
      operations:
      - method: GET
        name: get
        description: List workspace pull requests for a user
        call: cloud-rest-pullrequests.get
        with:
          state: rest.state
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: cloud-rest-pullrequests-mcp
    port: 9090
    transport: http
    description: MCP adapter for Bitbucket API — Pullrequests. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: list-pull-requests-that-contain
      description: List pull requests that contain a commit
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cloud-rest-pullrequests.getpullrequestsforcommit
      with:
        workspace: tools.workspace
        repo_slug: tools.repo_slug
        commit: tools.commit
        page: tools.page
        pagelen: tools.pagelen
      outputParameters:
      - type: object
        mapping: $.
    - name: list-default-reviewers
      description: List default reviewers
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: cloud-rest-pullrequests.get
      outputParameters:
      - type: object
        mapping: $.
    - name: remove-user-default-reviewers
      description: Remove a user from the defau

# --- truncated at 32 KB (42 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket/refs/heads/main/capabilities/cloud-rest-pullrequests.yaml