Skip to content

get_pull_request

Get detail for a pull request. By default returns compact metadata only (no diff text). Pass include_diff=true to fetch the unified diff, capped at max_bytes (default 32 KB). When truncated, diff_truncated=true is returned along with diff_offset, diff_next_offset, diff_bytes_returned, and diff_bytes_available. Continue with this same tool by passing diff_next_offset as diff_offset and diff_snapshot_id unchanged.

read-only · idempotent

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes—
pull_request_idAnnotated[int, Field(description='Numeric ID of the pull request within the model.')]Yes—
include_diffAnnotated[bool, Field(description='Whether to fetch and return the unified diff. Defaults to false. Set to true to include diff text (capped at max_bytes).')]NoFalse
max_bytesAnnotated[int, Field(description='Maximum bytes of diff text to return when include_diff=true. Defaults to 32768 (32 KB). Clamped to [1024, 524288]. When exceeded, diff_truncated=true is set.')]No32 * 1024
diff_offsetAnnotated[int, Field(ge=0, description='Byte offset into the exact pull-request diff returned by a prior call. Use 0 to start or restart. A nonzero offset requires diff_snapshot_id from that response.')]No0
diff_snapshot_id`Annotated[strNone, Field(description=‘Snapshot identity returned with a pull-request diff. Pass it unchanged with diff_offset to continue; if the PR diff or its base/head commits changed, the request fails and must restart at diff_offset=0 without this field.’)]`NoNone
include_financial_deltaAnnotated[bool, Field(description='Whether to attach financial impact from the newest retained comparison pair whose base/head commit SHAs exactly match this PR. Defaults to false. This read never runs the model. Missing, stale, mismatched, failed, or unreadable evidence returns an explicit unavailable reason and provenance while preserving the PR detail. Use compare_runs for a known retained pair, or compare_branches for an explicitly requested fresh execution (requires runs:execute and creates two persisted runs).')]NoFalse
include_sheet_changesAnnotated[bool, Field(description='Whether to compute and attach a per-sheet, per-tab cell-change summary for changed .bsheet.json and historical .btsheet.json files. Defaults to false. When true, returns sheet_changes in the response — this is a summary alongside the raw diff, not a replacement for it: fetch the raw diff separately (or via include_diff=true) to see the exact JSON change. Fails open: compute errors degrade to an empty sheet_changes list without blocking the base response.')]NoFalse
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • pull_request_id (integer)
  • title (string)
  • body (string)
  • head_branch (string)
  • head_sha (string)
  • base_branch (string)
  • state (string)
  • author (object)
  • created_at (string)
  • updated_at (string)
  • merged (boolean)
  • lifecycle (string)
  • changed_file_count (integer)
  • input_sheets_changed (boolean)
  • requested_reviewers (array<object>)
  • reviewer_assignment_version (integer)
  • viewer_has_outstanding_request (boolean)
  • viewer_approval_required (boolean)
  • approval_summary_available (boolean)
  • diff (string)
  • diff_truncated (boolean)
  • diff_bytes_returned (integer)
  • diff_bytes_available (integer)
  • approvals (array)
  • approval_status (object)
  • actor (object)
  • collaboration_history (array)
  • workspace_id (string)

See the response example below for the full payload shape.

{
"name": "get_pull_request",
"arguments": {
"model_name": "forecasts",
"pull_request_id": 42
}
}
{
"pull_request_id": 42,
"title": "Aggressive growth scenario",
"body": "Bumps growth_rate from 10% to 15%.",
"head_branch": "scenario/aggressive-growth",
"head_sha": "def456abc123",
"base_branch": "main",
"state": "open",
"author": {
"kind": "human",
"display_name": "Alice"
},
"created_at": "2026-04-28T10:00:00+00:00",
"updated_at": "2026-04-28T10:00:00+00:00",
"merged": false,
"lifecycle": "open",
"changed_file_count": 3,
"input_sheets_changed": false,
"requested_reviewers": [
{
"reviewer_user_id": "22222222-2222-2222-2222-222222222222",
"display_name": "Bob",
"state": "requested",
"review_submitted_at": null
}
],
"reviewer_assignment_version": 1,
"viewer_has_outstanding_request": true,
"viewer_approval_required": false,
"approval_summary_available": true,
"diff": "",
"diff_truncated": false,
"diff_bytes_returned": 0,
"diff_bytes_available": 0,
"approvals": [],
"approval_status": {
"approval_count": 0,
"required_approvals": 1,
"independent_approval_required": false,
"independent_approval_source": "platform_default",
"independent_approval_version": 0,
"independence_satisfied": true,
"viewer_is_author": false,
"viewer_can_approve": true,
"viewer_has_outstanding_request": true,
"viewer_approval_required": false,
"ready_to_merge": false,
"blocking_reason": "denied by merge-policy:platform_default:v1: requires 1 eligible distinct approval(s) from actor kinds [human, delegated_agent, api_token], but found 0",
"approval_rule": "merge-policy:platform_default:v1",
"independence_rule": "independent-approval:platform_default:v0:optional"
},
"actor": {
"kind": "human",
"display_name": "Bob"
},
"collaboration_history": [],
"workspace_id": "dddddddd-dddd-dddd-dddd-dddddddddddd"
}
  • Module: Pull Requests
  • Requires an authenticated Bridge Town session (OAuth) or an API token.
  • approval_status reports the current versioned policy decision; viewer_approval_required is false unless policy binds an outstanding approval specifically to this viewer.
  • A missing authoritative summary is represented by approval_summary_available=false and approval_status=null, never by zero approval counts.
  • Reviewer states include requested, approved, changes_requested, commented, stale, dismissed, removed, and unavailable; removed reviewers’ identities are redacted.