Repository navigation
Conversation
…optional git_log's description was "Shows the commit logs". A small model asked for the most recent commit passed start_timestamp="now" and end_timestamp="now", got a bare "Commit history:" and concluded the repository had no commits (#5552). The description now says results are newest first and that both timestamps are optional filters to leave out unless a period is asked for, and each timestamp's description says what omitting it means. When a timestamp filter matches no commits, the result names the filter as the cause and says to omit both, instead of an empty history. The tool's name, parameters and schema types are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
|
|
| Tools | Prompts | Resources | Resource templates | |
|---|---|---|---|---|
| Base | 14 | 2 | 0 | 0 |
| Head | 14 | 2 | 0 | 0 |
tools
--- base/tools.json
+++ target/tools.json
- tools[git_log].description: "Shows the commit logs"
+ tools[git_log].description: "Shows the commit log, newest commit first. For the latest commits, pass only repo_path (and optional..."
- tools[git_log].inputSchema.properties.end_timestamp.description: "End timestamp for filtering commits. Accepts: ISO 8601 format (e.g., '2024-01-15T14:30:25'), relativ..."
+ tools[git_log].inputSchema.properties.end_timestamp.description: "Optional: only show commits at or before this time. Omit for no upper bound. Accepts: ISO 8601 forma..."
- tools[git_log].inputSchema.properties.start_timestamp.description: "Start timestamp for filtering commits. Accepts: ISO 8601 format (e.g., '2024-01-15T14:30:25'), relat..."
+ tools[git_log].inputSchema.properties.start_timestamp.description: "Optional: only show commits at or after this time. Omit for no lower bound. Accepts: ISO 8601 format..."Updated by this run for 7d246370e0b36482784a19d7aa82929bf210ce97.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the git_log guidance and filtered-empty response changes.
No open issues 🎉
What changed in this PR
This PR clarifies the Git reference server’s git_log guidance so models can request recent commits without unnecessary timestamp filters, addressing #5552 without changing the input schema.
Changes:
- Describes newest-first ordering and makes timestamp-filter optionality explicit.
- Adds a recovery hint when timestamp filters return no commits, leaving unfiltered responses unchanged.
- Updates the README, protocol tests, and tool metadata snapshot to reflect the behavior.
| File | Description |
|---|---|
src/git/tests/test_protocol.py |
Tests the empty-filter hint and model-visible ordering and optionality guidance. |
src/git/tests/snapshots/list_tools.json |
Updates the tool and timestamp descriptions in the wire snapshot. |
src/git/src/mcp_server_git/server.py |
Clarifies descriptions and adds the filtered-empty response hint. |
src/git/README.md |
Documents ordering, optional filters, and the returned text. |
Review effort: Balanced
|
Copilot round 1: clean (no findings, no suppressed comments). The review loop ends here on the first clean round; nothing was pushed after the review. |
Closes #5552
Description
git_log's description wasShows the commit logs. It did not say that results come newest first, or thatstart_timestamp/end_timestampcan be left out, and a small model asked for the most recent commit filtered itself to an empty window (start_timestamp="now",end_timestamp="now"), got a bareCommit history:and concluded the repository had no commits.This PR changes what the model reads, in the two places it reads it:
repo_path(and optionallymax_count), and that the two timestamps are optional filters to omit unless a period is asked for.Optional:and says what omitting it means (no lower / upper bound).Commit history:\nNo commits match the given start_timestamp/end_timestamp. Omit both to see the latest commits.TheCommit history:first line is kept, and a call with no timestamp is unchanged.The tool's name, parameters, schema types, defaults and annotations are unchanged.
Server Details
git(mcp-server-git)git_logtool's description, its two timestamp parameter descriptions, and its result text when a timestamp filter matches no commits; the README'sgit_logentry.Motivation and Context
#5552, with the reporter's measurements (
qwen3:4b-instruct, deterministic repository, answers checked in code): the "most recent commit" question went from 1/6 to 3/3 with a description of this shape, and they asked for the empty-result hint to cover a model that still adds filters.How Has This Been Tested?
A fixture repository with three commits (10 Jan, 10 Feb, 10 Mar 2026). Inspector CLI 2.9.0, server over stdio, every command run with
--protocol-era legacy(2025-11-25) and--protocol-era modern(2026-07-28); the output was the same in both eras, before and after.git_logas served, base7f383a8e:{"description":"Shows the commit logs","params":{"start_timestamp":"Start timestamp for filtering commits. Accepts: ISO 8601 format …","end_timestamp":"End timestamp for filtering commits. Accepts: ISO 8601 format …"}}This branch:
{"description":"Shows the commit log, newest commit first. For the latest commits, pass only repo_path (and optionally max_count). start_timestamp and end_timestamp are optional filters for a date range: omit them unless a specific period is asked for, because a range that holds no commits returns none.","params":{"start_timestamp":"Optional: only show commits at or after this time. Omit for no lower bound. Accepts: ISO 8601 format …","end_timestamp":"Optional: only show commits at or before this time. Omit for no upper bound. Accepts: ISO 8601 format …"}}The call from the issue,
--method tools/call --tool-name git_log --tool-args-json '{"repo_path":"…","max_count":1,"start_timestamp":"now","end_timestamp":"now"}':Commit history:\nCommit history:\nNo commits match the given start_timestamp/end_timestamp. Omit both to see the latest commits.Unchanged on the branch (identical to the base, both eras):
{"repo_path":"…","max_count":2}returns the 10 Mar commit, then the 10 Feb commit (newest first).{"repo_path":"…","start_timestamp":"2026-02-01","end_timestamp":"2026-02-28"}returns the 10 Feb commit only, with no hint.LLM client: Claude Code 2.1.327, headless (
claude -p --mcp-config … --strict-mcp-config --allowedTools mcp__git__git_log), against this branch's build. It has no era switch and does not print the negotiated version, so the era was not selected. Prompt: "who made the most recent commit and what is its message? Then call git_log with start_timestamp and end_timestamp both set to 'now' and quote exactly what the tool returned. List the exact arguments you passed." It calledgit_logwith{"repo_path": …, "max_count": 1}(no timestamps) and answered with the 10 Mar commit; the second call returned the hint text above verbatim.Not reproduced here: the reporter's small-model measurement (
qwen3:4b-instructthrough their AgentGrade harness). Their numbers for a description of this shape are in #5552.Tests (
src/git/tests/test_protocol.py, through an MCP client): thetools/listwire snapshot carries the new text; a new test asserts the description states the order and that both timestamps are optional and not required; a new test asserts an empty window returns the hint while the same call without filters returns the newest commit; the existing filter test now expects the hint for its two empty ranges.npm run local:gateexits 0; its interface diff shows exactly the three description changes.Breaking Changes
None. No client configuration changes. A client that matched the exact text
Commit history:\nfor an empty filtered result now sees a second line after it.Types of changes
Checklist
Additional context
b3c9386bin their fork), which Tanishq67m measured at 15/15. This PR was written independently, per the repository's contribution policy, and their work informed it.git_logfunction, which still returns the list of entries; it appears only when a timestamp was supplied and nothing matched.repo_pathtaken from--repository, changes the input schema of every tool. It is filed as a decision of its own: git: decide whether repo_path should default to the configured --repository #5610.🤖 Generated with Claude Code