Skip to main content
Glama

local_commit_msg

Read-only

Draft a commit message from a diff using a local code model, optionally reading the diff file server-side so large changes stay out of Claude's context.

Instructions

PREFER this tool over reading the file with Read when the file is large (>200 lines / >10 KB) and you only need a commit message, not the literal content.

Drafts a commit message from a diff, with a local code model.

Pass 'path' to a diff file (e.g. the output of `git diff` dumped to a file) and it is read
server-side, so the full diff does NOT enter Claude's context. Alternatively pass 'diff' as
text. ALWAYS review the message before using it.

The language follows the recent commits of the git repo that holds the 'path' file (so dump
the diff inside the repo), unless LOCAL_DELEGATE_COMMIT_LANGUAGE is set.

Args:
    diff: The diff as text (use this or 'path').
    path: Path to a file with the diff (read server-side).
    style: 'conventional' (Conventional Commits) or 'plain'.

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": "local_commit_msg"
  }
}

Input Schema

NameRequiredDescriptionDefault
diffNo
pathNo
styleNoconventional

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.6/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, and the description adds real behavior beyond that: the diff is read server-side so it never enters the model's context (a concrete token-cost disclosure), and the output language is inferred from the repository's recent commits unless LOCAL_DELEGATE_COMMIT_LANGUAGE is set. The warning to always review implies non-deterministic output quality, but it does not say what happens when neither input is supplied or how failures surface.

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

Conciseness4/5

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

Front-loaded with the routing rule, then the mechanism, then the caveat about language detection, then per-argument notes. Nearly every sentence adds information, though the sentence fragmentation in the opening ('...not the literal content.' then 'Drafts a commit message...') slightly interrupts the flow.

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?

An output schema exists, so return-value detail is unnecessary, and the description covers the two things an agent could not infer: the context-window saving from server-side file reading and the repo-derived commit language. Remaining ambiguity (all three params optional, so the neither-input case is undefined) is minor for a low-risk read-only drafting tool.

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 description coverage is 0%, so the description must carry the meaning and largely does: 'diff' is raw diff text, 'path' is a server-side-read file containing the diff, and 'style' accepts 'conventional' (Conventional Commits) or 'plain' — a value set the schema does not encode as an enum. It still leaves open whether an arbitrary style string is accepted, what the default is implied to be, and which input wins if both are passed.

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?

States a specific verb and artifact: "Drafts a commit message from a diff, with a local code model." It also explicitly positions itself against a non-sibling alternative (the Read tool), so an agent can tell immediately what this produces and why it differs from the other local_* tools.

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?

Gives an explicit selection rule ("PREFER this tool over reading the file with Read when the file is large (>200 lines / >10 KB) and you only need a commit message"), names the alternative, and states the two mutually exclusive input modes for diff vs path. It also adds the operational instruction to always review the result before use.

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