Skip to content

repo_search_commits: removing client-side-filters#1360

Open
krid-583 wants to merge 3 commits into
microsoft:mainfrom
krid-583:users/krid/repo-search-commits-description-fix
Open

repo_search_commits: removing client-side-filters#1360
krid-583 wants to merge 3 commits into
microsoft:mainfrom
krid-583:users/krid/repo-search-commits-description-fix

Conversation

@krid-583

@krid-583 krid-583 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Updated the repo_search_commits tool to remove all the added client-side-filters. Also added one more server side filter namely user which replaces committer. Updated historySimplificationMode to be included inside the searchCriteria as it was previously a dummy parameter for filtering.

GitHub issue number

Closes #1327

Associated Risks

None

PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Manually tested the tool. No changes in behaviour.

image image

@krid-583 krid-583 requested a review from a team as a code owner June 15, 2026 06:22
Comment thread src/tools/repositories.ts Outdated
server.tool(
REPO_TOOLS.search_commits,
"Search for commits in a repository with comprehensive filtering capabilities. Supports searching by description/comment text, time range, author, committer, specific commit IDs, and more. This is the unified tool for all commit search operations.",
"Search for commits in a repository with comprehensive filtering capabilities. Supports searching by description/comment text, time range, author, committer, specific commit IDs, and more. NOTE: searchText, authorEmail, committer, and committerEmail are client-side filters — they run against the commits already fetched from the API (limited by 'skip' and 'top'), not against the full repository history. Use API-level filters (fromDate, toDate, author, version) to narrow results before these filters apply.",

@dpaquette dpaquette Jun 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big strange actually. I'm not sure we want to expose so many details through the tool description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had looked at commitSearchResults api as you asked. I found out that it doesn't support some of the existing filter parameters in the tool.

It only supports this:

{
  "searchText": "fix bug",
  "$skip": 0,
  "$top": 50,
  "filters": {
    "Project":    ["MyProject"],
    "Repository": ["MyRepo"],
    "Branch":     ["refs/heads/main"],
    "Author":     ["Alice Doe <[email protected]>"]
  },
  "$orderBy": [
    {
      "field": "authored_date",
      "sortOrder": "DESC"
    }
  ],
  "includeFacets": false
}

If we want only server side-filtering to be applicable, we might have to implement a seperate tool call.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should align with the search API, rather than try to invent something new here that our APIs don't support.

@danhellem how would you feel about dropping some of the search parameters for search commits to align it with the search API that we have available. IMO, having client side filtering in the MCP server layer confuses the situation. Everything works better if we stick to what our REST APIs support

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpaquette I agree 100%, the tool should match API. We should not be adding extra stuff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krid-583 Let's go ahead and change this tool to map to the inputs available for the commit search API

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated these

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you aligned with the wrong API. We should alight with the more advanced search API that supports searchText. The one you outlined in this comment thread

@krid-583 krid-583 changed the title repo_search_commits: clarify client-side vs server-side filtering in parameter descriptions repo_search_commits: removing client-side-filters Jun 23, 2026
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.

Bug: repo_search_commits searchText not passed to API as searchCriteria.messageContains

3 participants