Skip to main content
Glama

Git log

git_log
Read-only

Retrieves 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

NameRequiredDescriptionDefault
refNoOptional ref (branch, tag or commit sha). Default: HEAD.
grepNoFilter commit messages by substring.
pathNoRequired when blame=true: the file to blame.
blameNotrue switches to blame mode for path (optionally ref).
limitNoMax commits to return (default 20, max 200).
pathsNoOptional workspace-relative paths to limit the log.
authorNoFilter commits by author name or email.
reasonNoOptional why (max 400 chars), audit-logged.
max_linesNoBlame entries to return (default 1000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv4.5.0
    • removedInput schema / properties / blame / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / blame / description
      Previous value: -"1 switches to blame mode for path (optionally ref)."New value: +"true switches to blame mode for path (optionally ref)."
    • removedInput schema / properties / blame / maximum
      Removed value: -1
    • removedInput schema / properties / blame / minimum
      Removed value: -0
    • changedInput schema / properties / blame / type
      Previous value: -"integer"New value: +"boolean"
    • changedInput schema / properties / path / description
      Previous value: -"Required when blame=1: the file to blame."New value: +"Required when blame=true: the file to blame."
  2. Addedv4.0.0

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered; the description adds the important behavioral fact that blame=true plus path switches the tool's entire output mode. It also enumerates the available filters, though it does not mention the default/max limits on result size (those live only in the schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three front-loaded segments: what it does, when to use/avoid, and the return shape. No filler, no restatement of the tool name, and the output contract is compressed into a single scannable line.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Nine optional parameters and two distinct output modes with no output schema would normally need substantial prose, and the description supplies it by sketching both return shapes (commits[] fields, entries[] fields) plus the mode-switch condition. Nothing an agent needs in order to pick the right mode or filter correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by conveying cross-parameter semantics the schema only states piecewise — that blame mode is gated on blame=true together with path, and that ref/author/grep/paths act as log-mode filters. It does not explain interactions such as whether paths and grep combine or how ref applies in blame mode.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource (local commit log) and immediately distinguishes the second mode (per-line blame when blame=true with path). It also names what it is not (git branch --all for tags/remote refs, ci_logs for remote CI), so an agent can disambiguate without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use when' and 'Avoid when' clauses with named alternatives in each direction. The routing decision (recent commits vs. authoring lines vs. tag/remote work) is fully resolvable from the text.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.