get_diff

Get unified diff between two refs.

Parameters

Name Type Required Description
repo string Yes Repository path. Format: teams/team_slug/repo_slug or username/repo_slug.
source_ref string Yes The source git ref (branch, tag, or commit SHA) for the diff.
target_ref string Yes The target git ref (branch, tag, or commit SHA) for the diff.

Example

curl -X POST https://ghit.example/api/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get_diff",
      "arguments": {
        "repo": "teams/acme/webapp",
        "source_ref": "main",
        "target_ref": "feature/auth"
      }
    }
  }'

Response

Returns the unified diff output between the two refs as a text content block inside the standard MCP tool result.