Skip to content

Conversation

@quiloos39
Copy link

@quiloos39 quiloos39 commented Jan 30, 2026

Summary

When using the GitHub MCP server with Claude to analyze commit history—for example, to calculate working hours or review activity within a specific time period—the list_commits tool currently returns all commits without any date filtering. This forces the assistant to load and process unnecessary historical data, consuming valuable context window space and reducing efficiency.

This PR adds two optional parameters to the list_commits tool:

  • since - Only return commits after this date (ISO 8601 format)
  • until - Only return commits before this date (ISO 8601 format)

These parameters map directly to the GitHub Commits API query parameters that were previously unused.

Example Usage

{
  "owner": "github",
  "repo": "github-mcp-server",
  "since": "2025-01-01T00:00:00Z",
  "until": "2025-01-31T23:59:59Z"
}

Changes

  • Added time import to pkg/github/repositories.go
  • Added since and until schema properties with ISO 8601 format description
  • Added parameter parsing with proper RFC3339 date validation and user-friendly error messages
  • Passed parsed times to github.CommitsListOptions

Note

I'm not experienced with Go, but I thought this feature would be useful and wanted to contribute. This implementation was created with assistance from Claude.

🤖 Generated with 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