| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR adds a new get_file_blame tool that enables users to retrieve git blame information for files in GitHub repositories using the GraphQL API. The implementation includes comprehensive test coverage, proper error handling, and complete documentation updates.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| pkg/github/repositories.go | Implements the GetFileBlame tool with GraphQL queries for default branch resolution and blame data retrieval, including proper type conversions and JSON response formatting |
| pkg/github/tools.go | Registers GetFileBlame in the DefaultToolsetGroup for availability in the standard tool collection |
| pkg/github/repositories_test.go | Adds comprehensive test coverage including tool schema validation, default branch handling, specific ref queries, and error scenarios |
| pkg/github/toolsnaps/get_file_blame.snap | Tool schema snapshot documenting the API surface with ReadOnly annotation |
| README.md | Documents the new tool with parameter descriptions and usage information |
Sorry, something went wrong.
Sorry, something went wrong.
|
Just wanted to add a +1 to this PR! 👍 Having a git blame tool would be incredibly helpful for giving AI agents much better context. I understand you are busy, but I would love to see this merged when a maintainer has some bandwidth. Thanks for the hard work! |
Sorry, something went wrong.
|
Hi @MayorFaj could you please resolve conflicts in this pr? :) |
Sorry, something went wrong.
Hi @JoannaaKL , conflicts resolved |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for adding this tool — blame support is a great addition! I have a few concerns I'd love to see addressed:
Redundant GraphQL call for default branch: When ref is empty, there's a separate query just to fetch the default branch before the blame query. Please consider using HEAD as the expression or combining both into a single query to avoid the extra round-trip.
No pagination or size limit: A blame response for a large file (thousands of lines) could produce a massive JSON payload that blows past MCP response size limits or LLM context windows. Please add some form of truncation or line-range filtering — other tools in this codebase handle pagination, and this one should too.
No validation that object resolved to a Commit: If the ref expression resolves to a Tree or Blob, the ... on Commit fragment silently returns zero data and the tool returns an empty ranges array with no error. Let's add a nil/empty check on the commit object with a meaningful error message so users aren't left guessing.
No validation on path input: The path parameter is passed directly into the GraphQL query with no sanitization. Please add checks for empty strings, absolute paths, or path traversal patterns (../) — other tools in the codebase validate their path inputs.
Inline struct types: BlameRange and BlameResult are defined inside the handler closure. Let's move these to package-level types, consistent with how other tools structure their response types — it makes them testable and reusable.
age field is opaque: The age integer from GitHub's GraphQL API represents relative age compared to other ranges, not an absolute value. Please add some documentation in the tool description or response so an LLM consuming this doesn't misinterpret it.
Commit message not truncated: Full commit messages (including multi-line bodies) are included for every blame range. For a file with many ranges, this creates enormous redundant output — the same commit message repeated for every range it touches. Please consider including only the first line (subject), or deduplicating commits into a separate section.
e2e test changes are unrelated: The e2e/e2e_test.go changes (NewMCPServer → NewStdioMCPServer, adding Version, Logger) look like merge conflict resolution artifacts. Let's clean these up with a rebase so the PR diff only contains blame-related changes.
Missing newline at end of snap file: get_file_blame.snap is missing a trailing newline — minor, but please add one to avoid noisy diffs later.
No test for empty blame ranges: There's no test case for when the blame query returns successfully but with zero ranges (e.g., empty file). Please add one to verify the response structure is still valid in that case.
Sorry, something went wrong.
|
@JoannaaKL Thanks for the thorough review. I’ve addressed all of these in the latest update |
Sorry, something went wrong.
|
Hi @JoannaaKL Thanks for the review so far. Is there any fix I need to implement to get this PR merged please? |
Sorry, something went wrong.
|
malportado
El lun., 8 de junio de 2026 12:44 a. m., Mayowa Fajobi <
***@***.***> escribió:
… *MayorFaj* left a comment (github/github-mcp-server#1538)
<#1538 (comment)>
Hi @JoannaaKL <https://github.com/JoannaaKL> Thanks for the review so
far. Is there any fix I need to implement to get this PR merged please?
—
Reply to this email directly, view it on GitHub
<#1538?email_source=notifications&email_token=CFHFXJZZNUOLLPOB6BHUIR346ZOD3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRUGYYDQNBQG4Y2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4646084071>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CFHFXJ7KH6RSVOG5SERJY7L46ZOD3AVCNFSM6AAAAACYZMC4RWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMNBWGA4DIMBXGE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CFHFXJZ5GCKQKM6KEQFQLOL46ZOD3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRUGYYDQNBQG4Y2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/CFHFXJY2R7B2M7WFPEQ3VAT46ZOD3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRUGYYDQNBQG4Y2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sorry, something went wrong.
The cursor-pagination parameter description changed on main; regenerate the toolsnap and README so docs-check and toolsnap tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The git blame tool adds a new tool to the inventory, which carries a context-footprint cost for every client. Gate it behind a new file_blame feature flag (user opt-in via --features / X-MCP-Features) that is also auto-enabled in insiders mode, so it is not advertised by default. Regenerated README, feature-flags.md and insiders-features.md docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Sorry for slow merge, adding it behind feature flag, and in insiders mode so it can be tried by everyone.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This pull request adds a new tool for retrieving git blame information for files in a GitHub repository, along with comprehensive tests and documentation updates. The main focus is on enabling users to see who last modified each line in a file, with support for specifying branches, tags, or commit SHAs.
New Git Blame Tool Integration
Documentation and Tool Snapshots
Closes: #504