Skip to content

Commit 3fba548

Browse files
committed
feat: add get_file_blame tool
1 parent 3a4bc26 commit 3fba548

5 files changed

Lines changed: 961 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,17 @@ The following sets of tools are available:
12051205
- `repo`: Repository name (string, required)
12061206
- `sha`: Commit SHA, branch name, or tag name (string, required)
12071207

1208+
- **get_file_blame** - Get file blame information
1209+
- **Required OAuth Scopes**: `repo`
1210+
- `end_line`: Optional 1-based ending line of the window of interest. Must be >= start_line when both are provided. (number, optional)
1211+
- `owner`: Repository owner (username or organization) (string, required)
1212+
- `page`: Page number for pagination (min 1) (number, optional)
1213+
- `path`: Path to the file in the repository, relative to the repository root (string, required)
1214+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1215+
- `ref`: Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD). (string, optional)
1216+
- `repo`: Repository name (string, required)
1217+
- `start_line`: Optional 1-based starting line of the window of interest. Only ranges overlapping [start_line, end_line] are returned, clamped to the window. (number, optional)
1218+
12081219
- **get_file_contents** - Get file or directory contents
12091220
- **Required OAuth Scopes**: `repo`
12101221
- `owner`: Repository owner (username or organization) (string, required)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "Get file blame information"
5+
},
6+
"description": "Get git blame information for a file, showing the commit that last modified each line. Ranges share commit metadata via the top-level 'commits' map keyed by SHA. Use 'start_line'/'end_line' to restrict the result to a window of the file, and 'page'/'perPage' to page through returned ranges. Matching ranges are capped at 1000; when the cap is hit 'truncated' is set to true and 'total_ranges' reports the pre-cap match count.",
7+
"inputSchema": {
8+
"properties": {
9+
"end_line": {
10+
"description": "Optional 1-based ending line of the window of interest. Must be \u003e= start_line when both are provided.",
11+
"minimum": 1,
12+
"type": "number"
13+
},
14+
"owner": {
15+
"description": "Repository owner (username or organization)",
16+
"type": "string"
17+
},
18+
"page": {
19+
"description": "Page number for pagination (min 1)",
20+
"minimum": 1,
21+
"type": "number"
22+
},
23+
"path": {
24+
"description": "Path to the file in the repository, relative to the repository root",
25+
"type": "string"
26+
},
27+
"perPage": {
28+
"description": "Results per page for pagination (min 1, max 100)",
29+
"maximum": 100,
30+
"minimum": 1,
31+
"type": "number"
32+
},
33+
"ref": {
34+
"description": "Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD).",
35+
"type": "string"
36+
},
37+
"repo": {
38+
"description": "Repository name",
39+
"type": "string"
40+
},
41+
"start_line": {
42+
"description": "Optional 1-based starting line of the window of interest. Only ranges overlapping [start_line, end_line] are returned, clamped to the window.",
43+
"minimum": 1,
44+
"type": "number"
45+
}
46+
},
47+
"required": [
48+
"owner",
49+
"repo",
50+
"path"
51+
],
52+
"type": "object"
53+
},
54+
"name": "get_file_blame"
55+
}

0 commit comments

Comments
 (0)