Git log
git_logRetrieves recent commits or per-line blame for a file, with filters for ref, author, message, and paths. Use it to inspect local history or identify who last changed specific lines.
Instructions
Local commit log, or per-line blame when blame=true with path. Filters: ref, author, grep, paths. Use when: you need recent commits or who last touched lines (blame). Avoid when: you need tags/remote refs only (git branch --all) or a remote CI’s log (ci_logs). Output: mode=log: commits[] {sha, short_sha, author, email, authored_at, committer, subject, body}, count. mode=blame: entries[] {line, commit, author, authored_at, summary}, lines.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "git_log"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional ref (branch, tag or commit sha). Default: HEAD. | |
| grep | No | Filter commit messages by substring. | |
| path | No | Required when blame=true: the file to blame. | |
| blame | No | true switches to blame mode for path (optionally ref). | |
| limit | No | Max commits to return (default 20, max 200). | |
| paths | No | Optional workspace-relative paths to limit the log. | |
| author | No | Filter commits by author name or email. | |
| reason | No | Optional why (max 400 chars), audit-logged. | |
| max_lines | No | Blame entries to return (default 1000). |