Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,17 @@ runtime behavior (such as output formatting) won't appear here.
- `repo`: Repository name (string, required)
- `title`: The new title for the pull request (string, required)

### `file_blame`

- **get_file_blame** - Get file blame information
- **Required OAuth Scopes**: `repo`
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
- `end_line`: Optional 1-based ending line of the window of interest. Must be >= start_line when both are provided. (number, optional)
- `owner`: Repository owner (username or organization) (string, required)
- `path`: Path to the file in the repository, relative to the repository root (string, required)
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
- `ref`: Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD). (string, optional)
- `repo`: Repository name (string, required)
- `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)

<!-- END AUTOMATED FEATURE FLAG TOOLS -->
13 changes: 13 additions & 0 deletions docs/insiders-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ The list below is generated from the Go source. It covers tool **inventory and s
- `since`: Filter by date (ISO 8601 timestamp) (string, optional)
- `state`: Filter by state, by default both open and closed issues are returned when not provided (string, optional)

### `file_blame`

- **get_file_blame** - Get file blame information
- **Required OAuth Scopes**: `repo`
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
- `end_line`: Optional 1-based ending line of the window of interest. Must be >= start_line when both are provided. (number, optional)
- `owner`: Repository owner (username or organization) (string, required)
- `path`: Path to the file in the repository, relative to the repository root (string, required)
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
- `ref`: Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD). (string, optional)
- `repo`: Repository name (string, required)
- `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)

<!-- END AUTOMATED INSIDERS TOOLS -->

---
Expand Down
54 changes: 54 additions & 0 deletions pkg/github/__toolsnaps__/get_file_blame.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"annotations": {
"readOnlyHint": true,
"title": "Get file blame information"
},
"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 'perPage'/'after' to cursor-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.",
"inputSchema": {
"properties": {
"after": {
"description": "Cursor for pagination. Use the cursor from the previous response.",
"type": "string"
},
"end_line": {
"description": "Optional 1-based ending line of the window of interest. Must be \u003e= start_line when both are provided.",
"minimum": 1,
"type": "number"
},
"owner": {
"description": "Repository owner (username or organization)",
"type": "string"
},
"path": {
"description": "Path to the file in the repository, relative to the repository root",
"type": "string"
},
"perPage": {
"description": "Results per page for pagination (min 1, max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"ref": {
"description": "Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD).",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"start_line": {
"description": "Optional 1-based starting line of the window of interest. Only ranges overlapping [start_line, end_line] are returned, clamped to the window.",
"minimum": 1,
"type": "number"
}
},
"required": [
"owner",
"repo",
"path"
],
"type": "object"
},
"name": "get_file_blame"
}
7 changes: 7 additions & 0 deletions pkg/github/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const FeatureFlagIFCLabels = "ifc_labels"
// and field_values enrichment in list_issues / search_issues output.
const FeatureFlagIssueFields = "remote_mcp_issue_fields"

// FeatureFlagFileBlame is the feature flag name for the get_file_blame tool,
// which exposes git blame information for a file. It is gated so the extra tool
// is not advertised by default, keeping the tool surface small unless opted in.
const FeatureFlagFileBlame = "file_blame"

// AllowedFeatureFlags is the allowlist of feature flags that can be enabled
// by users via --features CLI flag or X-MCP-Features HTTP header.
// Only flags in this list are accepted; unknown flags are silently ignored.
Expand All @@ -27,6 +32,7 @@ var AllowedFeatureFlags = []string{
FeatureFlagIssueFields,
FeatureFlagIssuesGranular,
FeatureFlagPullRequestsGranular,
FeatureFlagFileBlame,
}

// InsidersFeatureFlags is the list of feature flags that insiders mode enables.
Expand All @@ -37,6 +43,7 @@ var InsidersFeatureFlags = []string{
MCPAppsFeatureFlag,
FeatureFlagCSVOutput,
FeatureFlagIssueFields,
FeatureFlagFileBlame,
}

// FeatureFlags defines runtime feature toggles that adjust tool behavior.
Expand Down
Loading
Loading