update_pull_request
Update the title and/or body of an open pull request. Requires at least Editor role. Pass expected_updated_at from get_pull_request to reject the update 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 update is applied.
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 | — | |
title | `Annotated[str | None, Field(description=‘Replacement PR title. Omit to leave the title unchanged.’)]` | No | None |
body | `Annotated[str | None, Field(description=‘Replacement PR body. Omit to leave the body unchanged.’)]` | No | None |
expected_updated_at | Annotated[str, Field(description='Optional updated_at value observed from get_pull_request. The update 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. The update 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)title(string)body(string)state(string)merged(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": "update_pull_request", "arguments": { "model_name": "forecasts", "pull_request_id": 42, "title": "Aggressive growth scenario — revised", "body": "Bumps growth_rate from 10% to 15% and documents downside sensitivity.", "expected_updated_at": "2026-04-28T10:00:00+00:00", "expected_head_sha": "def456abc123" }}Response
Section titled “Response”{ "model": "forecasts", "pull_request_id": 42, "title": "Aggressive growth scenario — revised", "body": "Bumps growth_rate from 10% to 15% and documents downside sensitivity.", "state": "open", "merged": false, "changed": true, "message": "Pull request #42 updated."}- Module:
Pull Requests - Requires authentication via API token or Auth0 JWT.