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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_key": "<project_key>",
"code_repo_path": "<code_repo_path>"
},
"name": "install_precommit_guard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | ||
| project_key | Yes | ||
| code_repo_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||