close_pull_request
Close an open pull request without merging it. Requires at least Editor role. Pass expected_updated_at from get_pull_request to reject the close if PR metadata changed since it was read, and expected_head_sha to reject it if the head branch received new commits. Stale expected state fails without mutation. Calling this on a closed or merged PR is idempotent: changed=false is returned and no mutation occurs.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | Annotated[str, Field(description='Name of the Bridge Town model.')] | Yes | — | |
pull_request_id | Annotated[int, Field(description='Numeric ID of the pull request within the model.')] | Yes | — | |
expected_updated_at | Annotated[str, Field(description='Optional updated_at value observed from get_pull_request. Closing fails without mutation if the PR metadata changed since it was read.')] | No | '' | |
expected_head_sha | Annotated[str, Field(description='Optional head_sha observed from get_pull_request. Closing fails without mutation if new commits were pushed to the PR branch.')] | No | '' | |
workspace_id | `Annotated[str | None, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
model(string)pull_request_id(integer)state(string)merged(boolean)closed(boolean)changed(boolean)message(string)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "close_pull_request", "arguments": { "model_name": "forecasts", "pull_request_id": 42, "expected_updated_at": "2026-04-28T10:00:00+00:00", "expected_head_sha": "def456abc123" }}Response
Section titled “Response”{ "model": "forecasts", "pull_request_id": 42, "state": "closed", "merged": false, "closed": true, "changed": true, "message": "Pull request #42 closed."}- Module:
Pull Requests - Requires authentication via API token or Auth0 JWT.