Skip to main content
Glama

Commit

commit

Stage all tracked and untracked changes across selected repositories and record them with one message, never rewriting history. Preview with a dry run, then pair with push to finish a cross-repo change.

Instructions

git add -A + git commit -m across the selected repos (stages tracked AND untracked; "nothing to commit" is a no-op). Never amends or rewrites history, and never records another checkout (an agent's worktree) as a gitlink. Commits the main checkout only; add worktrees: true to also commit linked worktrees' files on their own branches. Pair with push to finish a cross-repo change. Requires selector and message. Executing needs --allow-writes AND confirm:true; dry_run:true previews the target set with neither.

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": {
      "selector": "<selector>",
      "message": "<message>"
    },
    "name": "commit"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoMust be true to actually act; preview first with dry_run.
dry_runNoPreview the resolved target set without acting.
messageYesCommit message, applied to every selected repo (required).
selectorYesPredicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. "pay*"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. "payments"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, worktree_work (a linked worktree holds uncommitted files or commits never pushed), detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (glob like name, e.g. "feat/*"; an exact name matches itself), attention ("any"|"notice"|"warn"|"risk"). Remote (needs a GitHub token): ci ("passing"|"failing"|"pending"|"none"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {"all": true} for the whole fleet.
worktreesNoAlso act in each selected repo's linked worktrees, where coding agents leave work: push their branches to origin (publishing a new one) or commit their files on their own branches. Off by default; without it the result and the dry run say what was left in them. Preview with dry_run first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.11
    • addedInput schema / properties / worktrees
      Added value: +{
      +  "description": "Also act in each selected repo's linked worktrees, where coding agents leave work: push their branches to origin (publishing a new one) or commit their files on their own branches. Off by default; without it the result and the dry run say what was left in them. Preview with dry_run first.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv0.9.2
    • changedInput schema / properties / selector / description
      Previous value: -"Predicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. \"pay*\"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. \"payments\"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (glob like name, e.g. \"feat/*\"; an exact name matches itself), attention (\"any\"|\"notice\"|\"warn\"|\"risk\"). Remote (needs a GitHub token): ci (\"passing\"|\"failing\"|\"pending\"|\"none\"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {\"all\": true} for the whole fleet."New value: +"Predicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. \"pay*\"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. \"payments\"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, worktree_work (a linked worktree holds uncommitted files or commits never pushed), detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (glob like name, e.g. \"feat/*\"; an exact name matches itself), attention (\"any\"|\"notice\"|\"warn\"|\"risk\"). Remote (needs a GitHub token): ci (\"passing\"|\"failing\"|\"pending\"|\"none\"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {\"all\": true} for the whole fleet."
  3. Changed1 schema field changedv0.8.21
    • changedInput schema / properties / selector / description
      Previous value: -"Predicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. \"pay*\"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. \"payments\"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (exact name), attention (\"any\"|\"notice\"|\"warn\"|\"risk\"). Remote (needs a GitHub token): ci (\"passing\"|\"failing\"|\"pending\"|\"none\"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {\"all\": true} for the whole fleet."New value: +"Predicate that selects repos across the fleet; set fields to AND them, omit a field for no constraint (ADR-024). Scope: all (bool — the whole fleet), ids[str], name (glob, e.g. \"pay*\"), path_glob (* stays within one path segment, ** crosses /), root, group (a config-defined cluster name, e.g. \"payments\"). Local state: dirty, ahead (alias unpushed), behind, diverged, no_upstream, unpublished (a branch never pushed although the repo has a remote), stale_fetch (remote not fetched for over 14 days), has_stash, detached, conflicted, in_operation (merge/rebase/… mid-flight), error, branch (glob like name, e.g. \"feat/*\"; an exact name matches itself), attention (\"any\"|\"notice\"|\"warn\"|\"risk\"). Remote (needs a GitHub token): ci (\"passing\"|\"failing\"|\"pending\"|\"none\"), min_prs (int). Combine: any_of[selector] (OR), not (selector). The empty selector {} matches NOTHING by design — pass {\"all\": true} for the whole fleet."
  4. 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 already declare destructiveHint=false and idempotentHint=false, but the description goes far beyond: 'nothing to commit' is a no-op, it never amends or rewrites history, it never records an agent worktree as a gitlink, it touches the main checkout only, and execution requires --allow-writes AND confirm:true. These are exactly the behavioral traits an agent needs before firing a write operation.

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 concrete git equivalent, then safety guarantees, then prerequisites and the confirm/dry_run contract. Dense and nearly waste-free, though the long parenthetical clauses make it heavier than it needs to be for a five-parameter tool.

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?

No output schema exists, yet the description covers side effects, no-op conditions, history-safety, worktree behavior, the required confirmation gate, and the dry-run preview path. For a destructive-capable, nested-selector tool, an agent has everything needed to call it safely.

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 coverage is 100%, so baseline is 3, but the description adds real meaning: it ties confirm to an out-of-schema '--allow-writes' prerequisite, clarifies dry_run previews 'with neither', and explains what worktrees:true actually does to linked worktrees' branches. The selector's empty-object trap is documented in the schema itself, so no extra credit there.

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 the exact underlying operations ('git add -A + git commit -m <message>'), the scope ('across the selected repos'), and the staging semantics (tracked AND untracked). This is a specific verb+resource with enough precision that an agent knows exactly what will happen without opening the schema.

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?

Explicitly routes the agent: 'Pair with push to finish a cross-repo change' names the sibling and the condition, and 'add worktrees: true to also commit linked worktrees' flags the main-checkout default. It also mandates dry_run preview and confirm for execution. Missing only an explicit statement of when NOT to commit (e.g. what to use instead for inspection), but coverage is well above adequate.

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