You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a compare_commits tool wrapping the GitHub "Compare two commits"
REST endpoint (GET /repos/{owner}/{repo}/compare/{base}...{head}), so
agents can diff two branches, tags, or commit SHAs directly instead of
approximating it with two list_commits calls.
Returns ahead/behind counts, the commits unique to head, and the
changed files, trimmed via a new MinimalCommitsComparison type. A
`detail` parameter (none/stats/full_patch, matching get_commit)
controls how much per-file diff content is included.
-`base`: Base branch, tag, or commit SHA to compare from (string, required)
1249
+
-`detail`: Level of detail to include for changed files. "none" omits stats and files entirely. "stats" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. "full_patch" additionally includes the unified diff content for each file and can be very large. (string, optional)
1250
+
-`head`: Head branch, tag, or commit SHA to compare to (string, required)
1251
+
-`owner`: Repository owner (string, required)
1252
+
-`page`: Page number for pagination (min 1) (number, optional)
1253
+
-`perPage`: Results per page for pagination (min 1, max 100) (number, optional)
"description": "Compare two commits, branches, or tags in a GitHub repository, returning the ahead/behind commit counts, the list of commits unique to head, and the files changed between them",
8
+
"inputSchema": {
9
+
"properties": {
10
+
"base": {
11
+
"description": "Base branch, tag, or commit SHA to compare from",
12
+
"type": "string"
13
+
},
14
+
"detail": {
15
+
"default": "stats",
16
+
"description": "Level of detail to include for changed files. \"none\" omits stats and files entirely. \"stats\" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. \"full_patch\" additionally includes the unified diff content for each file and can be very large.",
17
+
"enum": [
18
+
"none",
19
+
"stats",
20
+
"full_patch"
21
+
],
22
+
"type": "string"
23
+
},
24
+
"head": {
25
+
"description": "Head branch, tag, or commit SHA to compare to",
26
+
"type": "string"
27
+
},
28
+
"owner": {
29
+
"description": "Repository owner",
30
+
"type": "string"
31
+
},
32
+
"page": {
33
+
"description": "Page number for pagination (min 1)",
34
+
"minimum": 1,
35
+
"type": "number"
36
+
},
37
+
"perPage": {
38
+
"description": "Results per page for pagination (min 1, max 100)",
Description: "Base branch, tag, or commit SHA to compare from",
360
+
},
361
+
"head": {
362
+
Type: "string",
363
+
Description: "Head branch, tag, or commit SHA to compare to",
364
+
},
365
+
"detail": {
366
+
Type: "string",
367
+
Enum: []any{"none", "stats", "full_patch"},
368
+
Description: "Level of detail to include for changed files. \"none\" omits stats and files entirely. \"stats\" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. \"full_patch\" additionally includes the unified diff content for each file and can be very large.",
Description: t("TOOL_COMPARE_COMMITS_DESCRIPTION", "Compare two commits, branches, or tags in a GitHub repository, returning the ahead/behind commit counts, the list of commits unique to head, and the files changed between them"),
381
+
Annotations: &mcp.ToolAnnotations{
382
+
Title: t("TOOL_COMPARE_COMMITS_USER_TITLE", "Compare two commits"),
0 commit comments