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
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | Annotated[str, Field(description='Name of the Bridge Town project.')] | Yes | — | |
ref_a | Annotated[str, Field(description='First git ref to diff from (commit SHA, branch name, or tag).')] | Yes | — | |
ref_b | Annotated[str, Field(description='Second git ref to diff to (commit SHA, branch name, or tag). Defaults to HEAD if omitted.')] | Yes | — | |
path | Annotated[str, Field(description="Project-relative file path (e.g. 'model/revenue.py'). Omit to operate on the whole project.")] | No | '' | |
max_bytes | Annotated[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
Section titled “Returns”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.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "diff", "arguments": { "project_name": "forecasts", "ref_a": "0123456789abcdef0123456789abcdef01234567", "ref_b": "abc1234def5678901234567890abcdef12345678", "model_name": "revenue" }}Response
Section titled “Response”{ "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.