Skip to content

diff

Show a unified diff between two refs (commit SHAs or branch names) of a Bridge Town project. Refs are detected automatically: a ref consisting of 7–40 hexadecimal characters is treated as a commit SHA; anything else is treated as a branch name. Use list_versions to find commit SHAs. The diff shows exactly what changed between ref_a and ref_b across all files, or only the specified file when path (e.g.

read-only

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
ref_aAnnotated[str, Field(description='First git ref to diff from (commit SHA, branch name, or tag).')]Yes
ref_bAnnotated[str, Field(description='Second git ref to diff to (commit SHA, branch name, or tag). Defaults to HEAD if omitted.')]Yes
pathAnnotated[str, Field(description="Project-relative file path (e.g. 'model/revenue.py'). Omit to operate on the whole project.")]No''
max_bytesAnnotated[int, Field(description='Maximum bytes of diff text to return. Defaults to 32768 (32 KB). Clamped to [1024, 524288]. When the full diff exceeds this limit, the response includes truncated=true, bytes_returned, and bytes_available. Use a scoped path filter or increase max_bytes to retrieve more.')]No_DIFF_DEFAULT_MAX_BYTES

Returns a structured object. Top-level fields:

  • project (string)
  • ref_a (string)
  • ref_b (string)
  • path (null)
  • diff (string)
  • has_changes (boolean)

See the response example below for the full payload shape.

{
"name": "diff",
"arguments": {
"project_name": "forecasts",
"ref_a": "0123456789abcdef0123456789abcdef01234567",
"ref_b": "abc1234def5678901234567890abcdef12345678",
"model_name": "revenue"
}
}
{
"project": "forecasts",
"ref_a": "0123456789abcdef0123456789abcdef01234567",
"ref_b": "abc1234def5678901234567890abcdef12345678",
"path": null,
"diff": "diff --git a/model/revenue.py b/model/revenue.py\n@@\n-growth_rate = 0.10\n+growth_rate = 0.15\n",
"has_changes": true
}
  • Module: Versions
  • Requires authentication via API token or Auth0 JWT.