Skip to main content
Glama

git

Run git subcommands through a policy-gated tool that enforces tiered permissions for read, write, destructive, and network operations, and prevents cross-session conflicts.

Instructions

Run git through one tiered, policy-gated tool (no shell). Read subcommands (status, log, diff, show, blame, shortlog, branch/tag/stash listing) always run. Write subcommands (add, commit, switch, mv, branch/tag create, stash push/pop) need [git] allow_writes (default on). Destructive subcommands (reset, clean, checkout, restore, rebase, revert, cherry-pick, branch/tag delete, stash drop) need allow_destructive AND confirm:true. Network subcommands (push, fetch, pull) need allow_push AND confirm:true; force-pushing a protected branch (via -f/--force or a +refspec) and using an ad-hoc URL/remote (incl. any :: helper) on any network subcommand are always refused — and a force push must name its destination branch (a bare -f or +HEAD that relies on the current branch is refused, since it may target a protected branch). Typed parameters: add uses files (staged with -A semantics — new/modified/deleted); commit uses message (plus an optional files list for a path-limited commit, the safe way to commit just your change in a shared worktree); every other subcommand uses args. Cross-session guard: plumb tracks the HEAD+branch each session last observed per repo; before a write/destructive op, if a DIFFERENT plumb session moved it since this session's last observation, the op is refused unless re-run with confirm:true, and the response names the peer session and the old→new refs (movement by this session, an external tool, or an unknown mover adds no friction). expected_head pins the exact HEAD commit for write/destructive ops — a mismatch refuses the call outright. Attribution: with [git] commit_trailer = true (default off) every plumb-mediated commit is stamped with a Plumb-Session: trailer; regardless of that knob, workspace_sessions lists recent commits per session (short SHA, subject, repository) from its recent-writes feed. Peer intents: with [collab] intents = true, a repo-state op (any destructive-tier op, plus commit/switch/checkout) also surfaces live peer share_intent claims covering this repository as an advisory warning naming the peer and the claim — informational only: it never blocks the op and never requires confirm.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoFlags and arguments passed directly to git for all subcommands except add and commit. Examples: ["--oneline", "-10"] for log; ["--cached"] or ["--staged"] for diff (shows staged changes ready to commit); ["--staged"] for restore. Ignored when subcommand is "add" (use files) or "commit" (use message).
repoNoPath to any file or directory inside the repository. Omit to use the attached workspace; if no workspace is attached the call is refused (git never falls back to the daemon's working directory). To operate on a nested git submodule, set this to a path inside the submodule — git resolves to the submodule's own root, so add/commit land there; a command run against the superproject only records the submodule's commit pointer, never its file contents.
filesNoPaths to act on. For subcommand "add": paths to stage (-A semantics — new, modified, and deleted entries all staged). For subcommand "commit": optional path-limited commit — commits ONLY these tracked paths (git commit -m <message> -- <files>), ignoring any unrelated staged changes already in the index; omit to commit the whole index. No glob expansion. Ignored by other subcommands.
confirmNoRequired (true) for destructive and network subcommands. Also required to override the cross-session ref-movement guard: when a DIFFERENT plumb session moved this repo's HEAD/branch since this session last observed it, a write/destructive op is refused until re-run with confirm:true.
messageNoCommit message — only used for subcommand "commit". Maps to -m; pre-commit hooks always run. Combine with files to commit only specific paths. Not used by any other subcommand.
subcommandNoGit subcommand to run. Read (always): diff, log, show, blame, status, shortlog, check-ignore, plus branch/tag/stash listing. Write (needs allow_writes, default on): add, commit, switch, mv, branch/tag create, stash push/pop. Destructive (needs allow_destructive + confirm): reset, clean, checkout, restore, rebase, revert, cherry-pick, branch/tag delete, stash drop. Network (needs allow_push + confirm): push, fetch, pull.
expected_headNoOptimistic-concurrency guard for write/destructive subcommands (mirrors edit_file's expected_mtime): any git revision (full/short SHA, branch, tag) naming the commit HEAD must be at. When supplied and HEAD resolves elsewhere — or resolves to nothing — the operation is refused before running, regardless of which session (or external tool) moved it. Ignored by read and network subcommands. Omit for no check.
Behavior5/5

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

With no annotations, the description fully carries the transparency burden. It discloses exact gating rules, refusal conditions (force-push to protected branches, ad-hoc URLs), the cross-session ref-movement guard, expected_head optimistic concurrency, commit trailer attribution, and advisory peer intents. This is exceptionally transparent.

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 long, but every sentence adds necessary policy detail for a complex tool. However, the single-block structure makes key rules harder to scan; breaking it into bullet points or sections would improve readability without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers policy, parameters, safety, and edge cases thoroughly. Yet it omits the return format (raw git stdout vs structured output) and does not explicitly state that subcommand is mandatory (though implied by the enum), leaving a small but notable gap for an agent invoking this tool.

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

Parameters5/5

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

Although schema coverage is 100%, the description enriches parameters significantly beyond the schema. It clarifies files' -A staging semantics, commit's path-limited behavior (safe for shared worktrees), repo's submodule resolution, confirm's role in overriding the session guard, and expected_head's concurrency check. This added meaning is critical for correct usage.

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 opens with 'Run git through one tiered, policy-gated tool (no shell)', specifying the verb and resource. It enumerates a full subcommand taxonomy (read/write/destructive/network) that distinguishes this tool from siblings like git_init, which is absent from the list. This is a clear, specific purpose.

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?

The description gives explicit policy tiers with permission requirements and confirm flags, examples for args usage, and guidance on when to use typed files vs args (e.g., path-limited commits). It also states constraints like 'no shell' and mandates a workspace or repo path, effectively saying when the tool applies and when it refuses.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server