Python tool API
This source-derived reference renders the registered tool modules. Import tool classes from their defining modules; the package root exports only version metadata. See tool contracts for arguments and core helpers for internal models and functions.
axm_git
axm-git — Git workflow automation for AXM agents.
commit_preflight
GitPreflightTool — show working tree status for agent decision-making.
GitPreflightTool
Bases: AXMTool
Report working tree changes so the agent can plan commits.
Registered as git_preflight via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/commit_preflight.py
name
property
Tool name used for MCP registration.
execute(*, path='.', diff_lines=200, **kwargs)
Show current working tree status and diff summary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root (required). |
'.'
|
diff_lines
|
int
|
Max diff lines to include (default 200, 0 to disable). |
200
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with file list, statuses, diff stats, and diff content. |
Source code in packages/axm-git/src/axm_git/tools/commit_preflight.py
render_text(*, files, diff_stat, diff, diff_truncated, max_diff_lines)
Render a compact text summary of preflight results.
Source code in packages/axm-git/src/axm_git/tools/commit_preflight.py
branch
GitBranchTool — create or checkout git branches.
GitBranchTool
Bases: AXMTool
Create or checkout a git branch in one call.
Registered as git_branch via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/branch.py
name
property
Tool name used for MCP registration.
execute(*, name, from_ref=None, checkout_only=False, delete=False, path='.', **kwargs)
Create, checkout, or delete a git branch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Branch name (required). |
required |
from_ref
|
str | None
|
Optional ref to branch from (tag, commit, branch). |
None
|
checkout_only
|
bool
|
If True, checkout existing branch without creating. |
False
|
delete
|
bool
|
If True, delete the branch ( |
False
|
path
|
str
|
Project root directory. |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with branch name on success. |
Source code in packages/axm-git/src/axm_git/tools/branch.py
commit
GitCommitTool — batched atomic commits with commit-hook handling.
GitCommitTool
Bases: AXMTool
Execute one or more atomic commits in a single call.
Each commit in the batch is processed sequentially: stage files,
run git commit (the repo's commit hooks fire automatically), and
capture the result. If a commit fails (e.g. a hook rejects it),
processing stops and the error is returned alongside any commits
that already succeeded.
When a commit hook auto-fixes files (e.g. ruff --fix),
the tool automatically re-stages and retries the commit once.
Verdict-Carrying Patch invariant — when a hook mutates staged
content on the autofix-retry path, ToolResult.data reports exactly
which files changed under hook_autofixed_files: list[str] (repo-root
relative). The field is always present: it is an empty list on the
clean path (no hooks, or no mutation) and never None. This lets a
consumer see that the patch it committed is not byte-for-byte the patch
it staged — the commit still carries a truthful verdict of what landed.
The hook runner is whatever the repo installs at
.git/hooks/pre-commit (pre-commit OR prek); axm-git never
invokes the runner directly — git does.
Registered as git_commit via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/commit.py
| Python | |
|---|---|
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', commits=None, profile=None, strict=False, **kwargs)
Execute batched commits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root (required). |
'.'
|
commits
|
list[dict[str, object]] | None
|
List of commit specs, each a dict with keys:
- |
None
|
profile
|
str | None
|
Optional identity profile name. Overrides
schedule-based resolution from |
None
|
strict
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with a list of committed results, an |
ToolResult
|
( |
ToolResult
|
( |
ToolResult
|
commit hook mutated during the autofix-retry — always present, |
ToolResult
|
|
Source code in packages/axm-git/src/axm_git/tools/commit.py
| Python | |
|---|---|
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
clone
GitCloneTool — clone a remote or local git repository.
GitCloneTool
Bases: AXMTool
Clone a git repository into a local directory.
Registered as git_clone via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/clone.py
name
property
Tool name used for MCP registration.
execute(*, url, dest, path='.', **kwargs)
Clone url into dest relative to path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL or local path to clone from. |
required |
dest
|
str
|
Destination directory name (relative to path). |
required |
path
|
str
|
Parent directory in which to create the clone (default: current working directory). |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with url, dest, absolute clone path, and |
ToolResult
|
|
Source code in packages/axm-git/src/axm_git/tools/clone.py
worktree
GitWorktreeTool — add, remove, and list git worktrees.
GitWorktreeTool
Bases: AXMTool
Add, remove, or list git worktrees.
Registered as git_worktree via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/worktree.py
| Python | |
|---|---|
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
name
property
Tool name used for MCP registration.
execute(*, action, path='.', worktree_path=None, branch=None, base=None, force=False, **kwargs)
Manage git worktrees.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
One of |
required |
path
|
str
|
Repository path. Git-root resolution and
|
'.'
|
worktree_path
|
str | None
|
For |
None
|
branch
|
str | None
|
Branch name for |
None
|
base
|
str | None
|
Base ref for |
None
|
force
|
bool
|
Force removal for |
False
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with worktree data on success. |
Source code in packages/axm-git/src/axm_git/tools/worktree.py
merge
GitMergeTool — squash-merge a branch into a target branch.
GitMergeTool
Bases: AXMTool
Squash-merge a branch into a target branch and commit.
Checks out target_branch, runs git merge --squash <branch>, then
commits the squashed changes (honouring the identity-profile system).
Registered as git_merge via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/merge.py
name
property
Tool name used for MCP registration.
execute(*, branch, target_branch=None, message=None, path='.', **kwargs)
Squash-merge branch into target_branch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
branch
|
str
|
The branch to merge in (required). |
required |
target_branch
|
str | None
|
The branch to merge into (default: the repo's resolved default branch). |
None
|
message
|
str | None
|
Commit message for the squash commit. Defaults to
|
None
|
path
|
str
|
Repository path. |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with |
Source code in packages/axm-git/src/axm_git/tools/merge.py
pull
GitPullTool — pull a remote branch into the local repository.
GitPullTool
Bases: AXMTool
Pull a remote branch (default origin main) into the local repo.
Registered as git_pull via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/pull.py
name
property
Tool name used for MCP registration.
execute(*, branch='main', remote='origin', path='.', **kwargs)
Pull remote/branch into the local repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
branch
|
str
|
Remote branch to pull (default |
'main'
|
remote
|
str
|
Remote name (default |
'origin'
|
path
|
str
|
Repository path. |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with |
Source code in packages/axm-git/src/axm_git/tools/pull.py
push
GitPushTool — push current branch with dirty-check and upstream detection.
GitPushTool
Bases: AXMTool
Push the current branch after verifying a clean working tree.
Registered as git_push via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/push.py
| Python | |
|---|---|
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', remote='origin', set_upstream=True, force=False, force_unconditional=False, **kwargs)
Push the current branch to a remote.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root directory. |
'.'
|
remote
|
str
|
Remote name (default |
'origin'
|
set_upstream
|
bool
|
Auto-set upstream for new branches. |
True
|
force
|
bool
|
If True, force-push using |
False
|
force_unconditional
|
bool
|
If True (and |
False
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with branch, remote, and push status. |
Source code in packages/axm-git/src/axm_git/tools/push.py
| Python | |
|---|---|
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
pr
GitPRTool — create GitHub pull requests via gh CLI.
GitPRTool
Bases: AXMTool
Create a GitHub pull request with optional auto-merge.
Registered as git_pr via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/pr.py
name
property
Tool name used for MCP registration.
execute(*, title, body=None, base=None, auto_merge=False, path='.', **kwargs)
Create a GitHub pull request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
PR title (required). |
required |
body
|
str | None
|
PR body/description. |
None
|
base
|
str | None
|
Base branch (default: the repo's resolved default branch). |
None
|
auto_merge
|
bool
|
Enable auto-merge with squash (default |
False
|
path
|
str
|
Repository path. |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with |
Source code in packages/axm-git/src/axm_git/tools/pr.py
await_merge
GitAwaitMergeTool — poll a GitHub PR until it is merged or times out.
GitAwaitMergeTool
Bases: AXMTool
Poll a GitHub PR until it reaches the MERGED state.
Blocks, querying gh pr view --json state every interval seconds
until the PR is merged, is closed, or timeout elapses. Registered as
git_await_merge via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/await_merge.py
name
property
Tool name used for MCP registration.
execute(*, pr, timeout=_DEFAULT_TIMEOUT, interval=_DEFAULT_INTERVAL, path='.', **kwargs)
Poll PR pr until merged or timed out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pr
|
str
|
PR number or URL (required). |
required |
timeout
|
int
|
Maximum seconds to wait (default 600). |
_DEFAULT_TIMEOUT
|
interval
|
int
|
Seconds between polls (default 30). |
_DEFAULT_INTERVAL
|
path
|
str
|
Repository path. |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with |
Source code in packages/axm-git/src/axm_git/tools/await_merge.py
release_diff
GitReleaseDiffTool — read-only SemVer bump decision for a package subdir.
GitReleaseDiffTool
Bases: AXMTool
Summarise commits/diff since the last tag to decide a SemVer bump.
Strictly read-only: issues only log, diff, tag and
rev-parse — never creates or pushes a tag. Scopes every log
and diff to the resolved package subdir so monorepo attribution
is correct. Registered as git_release_diff via axm.tools.
Source code in packages/axm-git/src/axm_git/tools/release_diff.py
| Python | |
|---|---|
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', **kwargs)
Compute a read-only release diff for the package at path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Package root (defaults to the current directory). |
'.'
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with current tag, commit summary, diffstat and a |
ToolResult
|
suggested next version. |
Source code in packages/axm-git/src/axm_git/tools/release_diff.py
tag
GitTagTool — one-shot semver tag: preflight + compute + create + verify + push.
GitTagTool
Bases: AXMTool
Create a semver release tag in one call.
Performs preflight checks (clean tree, CI status), computes the next version from Conventional Commits, creates an annotated tag, verifies hatch-vcs resolution, and pushes to origin.
Registered as git_tag via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/tag.py
| Python | |
|---|---|
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', version=None, **kwargs)
Create and push a semver tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root (required). |
'.'
|
version
|
str | None
|
Version override (optional, e.g. |
None
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with tag, version, and push status. |
Source code in packages/axm-git/src/axm_git/tools/tag.py
| Python | |
|---|---|
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |
check_ci(path)
Check CI status via gh for the CI run matching HEAD.
Returns one of green/red/pending/skipped/error. The status is derived
from the run whose headSha matches the current HEAD SHA, never from
runs[0] unconditionally: a stale green (HEAD moved past it) or a red
on an unrelated commit must not influence the verdict. When no run
matches HEAD, returns pending (block tagging until CI exists for the
exact commit being tagged).
Source code in packages/axm-git/src/axm_git/tools/tag.py
get_tag_prefix(path)
Read tag prefix from pyproject.toml tag-pattern (e.g. git/).
Returns the prefix string (e.g. "git/") or "" if none.
Source code in packages/axm-git/src/axm_git/tools/tag.py
resolve_version(version_override, current_tag, commits, *, tag_prefix='')
Resolve the next version tag.
Returns:
| Type | Description |
|---|---|
tuple[str, str, bool]
|
|
Source code in packages/axm-git/src/axm_git/tools/tag.py
verify_hatch_vcs(path, pkg_name)
Rebuild package and read resolved version (best-effort).