Skip to main content
Glama

install_precommit_guard

Installs a Git pre-commit hook that blocks commits staging files reserved by another agent, preventing conflicts in Agent Mail projects.

Instructions

Install the Agent Mail pre-commit guard into a git repository.

The guard blocks a commit that stages files another agent holds an exclusive file reservation on (set AGENT_MAIL_GUARD_MODE=warn to only warn). Commits must run with AGENT_NAME set to the committing agent. Any existing pre-commit hook is kept and still runs. Does nothing when worktree features are disabled (WORKTREES_ENABLED=0).

Parameters

project_key : str Project whose file reservations the guard enforces. code_repo_path : str Path to the git repository to install the hook into. format : str, optional Output format.

Returns

dict {"hook": "<path to the installed pre-commit hook>"}; empty string when skipped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNo
project_keyYes
code_repo_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.4

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so: it discloses what the guard blocks, the AGENT_MAIL_GUARD_MODE=warn escape hatch, the AGENT_NAME requirement for commits, that an existing pre-commit hook is preserved, and the disabled-worktree no-op condition. These are exactly the non-obvious side effects an agent needs before mutating a repo.

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?

Front-loaded with the action in sentence one, then behavior, then parameters and returns in scannable sections. The params/returns blocks are duplicated effort against the schema, but with 0% schema coverage they are load-bearing rather than padding.

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?

A mutation tool with no annotations is fully covered: scope, side effects, env-var preconditions, no-op condition, and the return shape (hook path, empty string when skipped). Nothing an agent needs to invoke it safely 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 description coverage is 0%, so the description must compensate, and it documents all three parameters via the numpydoc block: project_key (whose reservations are enforced), code_repo_path (target repo), and format. The format entry ('Output format') adds little beyond the name, keeping this short of a 5.

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 resource ('Install the Agent Mail pre-commit guard into a git repository') and implicitly distinguishes itself from the sibling uninstall_precommit_guard. An agent knows exactly what artifact is being created and where.

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

Usage Guidelines4/5

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

Gives clear operating context: the guard applies to commits staging files held under exclusive reservation, and it is a no-op when WORKTREES_ENABLED=0. It does not explicitly name the removal counterpart or spell out prerequisites for installation, so it stops short of full when/when-not routing.

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