Skip to main content
Glama
commit-check

commit-check-mcp

Official
by commit-check

Validate repository state

validate_repository_state
Idempotent

Validate a local git repository's latest commit message, author, branch name, and optional force-push safety in one call, returning pass/fail checks with actionable fixes.

Instructions

Validate what is already in a local git repository: the latest commit's message and author, the checked-out branch name and, optionally, whether pushing that branch to its upstream would be a force push. Leaves the working tree and commits untouched; the push check may run git fetch, which updates FETCH_HEAD and remote-tracking refs.

Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail' | 'warn' | 'skip' ('warn' = the config lists the check under warn, so the finding is reported without failing the run; 'skip' = the rule did not run, e.g. the author is in ignore_authors or there was nothing to check); value (what was checked); error (why it failed); suggest (advice for a person); fix (the corrected value when the correction is unambiguous, else ''); docs_url (documentation for the rule). On 'fail', apply a non-empty fix verbatim; when fix is '', rewrite following suggest; then validate again.

Use this to check a repository's current state in one call, e.g. after committing and before pushing, or in a hook. The include_* flags select the checks; at least one must be true. To validate values that are not yet committed use validate_commit_context or the single-aspect tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configNoInline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}.
repo_pathNoPath to the git repository to inspect; its cchk.toml or commit-check.toml is loaded and a relative config_path is resolved from it. Omit to use the server's working directory, which must then be a git repository.
config_pathNoPath to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path.
include_pushNoAlso check that pushing the current branch to its upstream would not be a force push; may run git fetch (updating FETCH_HEAD), and passes when the branch has no upstream. Default false.
include_authorNoValidate the author name and email of the latest commit (falling back to git config user.name/user.email). Default true.
include_branchNoValidate the name of the currently checked-out branch. Default true.
include_messageNoValidate the message of the latest commit (HEAD). Default true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.1.10
    • addedInput schema / properties / config / description
      Added value: +"Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {\"warn\": [\"message\"]} or {\"commit\": {\"require_body\": true}}."
    • addedInput schema / properties / config_path / description
      Added value: +"Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path."
    • addedInput schema / properties / include_author / description
      Added value: +"Validate the author name and email of the latest commit (falling back to git config user.name/user.email). Default true."
    • addedInput schema / properties / include_branch / description
      Added value: +"Validate the name of the currently checked-out branch. Default true."
    • addedInput schema / properties / include_message / description
      Added value: +"Validate the message of the latest commit (HEAD). Default true."
    • addedInput schema / properties / include_push / description
      Added value: +"Also check that pushing the current branch to its upstream would not be a force push; may run git fetch (updating FETCH_HEAD), and passes when the branch has no upstream. Default false."
    • addedInput schema / properties / repo_path / description
      Added value: +"Path to the git repository to inspect; its cchk.toml or commit-check.toml is loaded and a relative config_path is resolved from it. Omit to use the server's working directory, which must then be a git repository."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, so the tool is not purely read-only. The description clarifies the exact side effect: the push check 'may run git fetch, which updates FETCH_HEAD and remote-tracking refs', while 'leaves the working tree and commits untouched'. It also explains the nuanced status semantics ('skip' is not approval) that annotations cannot convey.

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?

The description is organized into three logical paragraphs (scope/side effects, return format, usage guidance), and every sentence contributes substantive information. It is somewhat long but not bloated, and the key operational facts (side effects, skip semantics, alternative tools) are front-loaded.

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?

Even though an output schema exists, the description adds critical operational context: the meaning of 'fail' vs 'skip', the advice to 'apply a non-empty fix verbatim', the note about FETCH_HEAD side effects, and the requirement that at least one include_* flag be true. Together these make the tool safely callable without ambiguity.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all seven parameters. The tool description adds no parameter-specific meaning beyond what the schema provides, only a high-level note that include_* flags select checks. Per the rubric, baseline 3 applies when the schema carries the heavy lifting.

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?

The description states a specific verb ('validate') with a clear resource ('local git repository') and enumerates the exact aspects validated (latest commit message/author, checked-out branch, optional push safety). It explicitly differentiates itself from single-aspect siblings by noting it checks 'current state in one call' and later tells the agent to use validate_commit_context or single-aspect tools for uncommitted values.

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?

Provides explicit when-to-use guidance: 'after committing and before pushing, or in a hook', and names the alternatives when not to use it ('To validate values that are not yet committed use validate_commit_context or the single-aspect tools'). It also states the constraint that at least one include_* flag must be true, which is not in the schema.

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