Skip to content

feat: add since and until date filters to list_commits#1928

Open
quiloos39 wants to merge 4 commits intogithub:mainfrom
quiloos39:feat/list-commits-date-filtering
Open

feat: add since and until date filters to list_commits#1928
quiloos39 wants to merge 4 commits intogithub:mainfrom
quiloos39:feat/list-commits-date-filtering

Conversation

@quiloos39
Copy link

@quiloos39 quiloos39 commented Jan 30, 2026

Summary

Add optional since and until date filter parameters to the list_commits tool, mapping to the existing GitHub Commits API query parameters that were previously unused.

Why

When using the GitHub MCP server to analyze commit history within a specific time period (e.g., calculating working hours or reviewing activity), the tool currently returns all commits without date filtering, consuming unnecessary context window space.

What changed

  • Added since and until schema properties with ISO 8601 format description to list_commits tool
  • Added parameter parsing with RFC3339 date validation and user-friendly error messages
  • Passed parsed times to github.CommitsListOptions
  • Updated toolsnap and generated docs

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed — two new optional input parameters (since, until) added to list_commits
  • New tool added

Prompts tested (tool changes only)

  • "List all commits in this repo from the last week"
  • "Show me commits between January 1 and January 31, 2025"
  • "What commits were made after 2025-06-01?"

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)

Note: I'm not experienced with Go, but I wanted to contribute this feature. This implementation was created with assistance from Claude Code.

Add optional `since` and `until` parameters to the list_commits tool,
allowing users to filter commits by date range using ISO 8601 format.

This enables more efficient commit queries for time-based workflows
like calculating working hours or reviewing activity within specific
periods, reducing unnecessary context from historical commits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@quiloos39 quiloos39 requested a review from a team as a code owner January 30, 2026 09:24
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.

1 participant