Skip to content

feat: Add search commit tool#2284

Open
Not-Dhananjay-Mishra wants to merge 2 commits intogithub:mainfrom
Not-Dhananjay-Mishra:search-commit
Open

feat: Add search commit tool#2284
Not-Dhananjay-Mishra wants to merge 2 commits intogithub:mainfrom
Not-Dhananjay-Mishra:search-commit

Conversation

@Not-Dhananjay-Mishra
Copy link
Copy Markdown

Summary

Added a new search_commits tool to the GitHub MCP server, allowing users and LLMs to search for commits across repositories using specialized GitHub search syntax

Why

This provides a missing capability for high-impact commit discovery and debugging that isn't possible with the existing list_commits tool
Fixes #2283

What changed

  • Implemented SearchCommits
  • Added the tool handler and MinimalSearchCommitsResult struct
  • Registered the new tool in pkg/github/tools.go

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

  • Search for all commits in the 'github/github-mcp-server' repository that mention 'vulnerability' or 'fix' in the last 6 months
  • Find all commits authored by 'github' across the organization that were committed after 2024-01-01.
  • Find the most recent commit that modified the search.go file with a message containing 'refactor'.
  • Search for commits in 'owner/repo' that are tagged with '[RELEASE]' to summarize recent major changes.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra requested a review from a team as a code owner April 3, 2026 07:26
@Not-Dhananjay-Mishra Not-Dhananjay-Mishra changed the title Search commit feat: Add search commit tool Apr 3, 2026
@Not-Dhananjay-Mishra
Copy link
Copy Markdown
Author

Not-Dhananjay-Mishra commented Apr 3, 2026

Here are some example use case :
Screenshot 2026-04-03 at 6 26 23 PM
Screenshot 2026-04-03 at 6 40 57 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool Request : Search Commit Tool

1 participant