Skip to main content
Glama

cmd_git

Run typed Git commands in a Waymark workspace for status, diffs, commits, branches, and pushes; read-only actions run automatically while changes require owner approval.

Instructions

Run a git command in a workspace as a typed action (no shell, no pager, no external diff or filter programs). Nothing can force-push. Reading (status, diff, log, show, branches, stashes, remotes) is automatic; changes wait for the owner unless the owner set them to Auto. reset_hard, clean and branch_delete are switched off unless the owner enables them. For a git operation not listed here use cmd_shell; for what changed on disk without git use code_changes_since. ACTIONS and optionsJson keys (* = required, paths relative to the workspace): status: - diff: staged, stat, revision, paths (array) log: count (1-200, default 20), oneline (default true), stat, revision, paths (array) show: revision*, stat branches, stashes, remotes: - add: paths (array) or all commit: message*, all branch_create: name*, from, switchTo branch_switch: name* stash_push: message, includeUntracked stash_pop: - restore: paths* (array), staged pull: remote, branch (fast-forward only) push: remote (default origin), branch, setUpstream reset_hard: revision (default HEAD) clean: dryRun (default true), paths (array) branch_delete: name* RETURNS: result and the output of git.

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": {
      "workspace": "<workspace>",
      "action": "<action>",
      "purpose": "<purpose>"
    },
    "name": "cmd_git"
  }
}

Input Schema

NameRequiredDescriptionDefault
guideNotrue: put the commands guide first in the result. Use on your first commands call, or when told it changed.
actionYesOne of: status, diff, log, show, branches, stashes, remotes, add, commit, branch_create, branch_switch, stash_push, stash_pop, restore, pull, push, reset_hard, clean, branch_delete
purposeYesOne sentence: why you run this. The owner reads it before approving, sees it live, and it is kept in the audit log.
workspaceYesWorkspace name as shown in Waymark (a single workspace; '*' is not accepted)
optionsJsonNoJSON object with the options of the action, for example {"message":"Fix null check"}. Omit when none are needed.
waitSecondsNoSeconds to wait for the result before returning a run id (default 30, at most about 45). The command keeps running; use cmd_wait to wait longer.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A5/5.0
Behavior5/5

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

Goes well beyond the annotations: no shell/pager/external diff or filter programs, force-push impossible, reset_hard/clean/branch_delete disabled unless the owner enables them, and pull is fast-forward only. This gating detail is essential because the destructiveHint=false annotation is only true by default, and the description is what explains that nuance.

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 safety and approval rules before the dense action/option table, which is the right order for an agent deciding whether to call. The table format is compact and every line carries call-relevant information; nothing is redundant 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?

For a 6-parameter, 19-action mutation tool with no output schema, the definition covers action semantics, option shapes, approval behavior, destructive-action gating, and the timeout/run-id handoff to cmd_wait. The terse 'RETURNS: result and the output of git' is acceptable since git output is self-describing and the schema covers waitSeconds/run-id behavior.

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?

Schema coverage is 100%, so baseline would be 3, but the description supplies the per-action optionsJson contract the schema only gestures at: required keys marked with *, array-vs-scalar types, defaults (count 20, oneline true, clean dryRun true, push remote origin), and a range (count 1-200). That is meaning an agent cannot get from the schema alone.

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?

Opens with a specific verb+resource ('Run a git command in a workspace as a typed action') and then enumerates all 19 supported actions, so an agent knows exactly the scope. It also distinguishes itself from siblings by naming cmd_shell for unlisted git operations and code_changes_since for non-git disk changes.

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?

Explicit routing rules are given: use cmd_shell for git operations not listed here, use code_changes_since for what changed on disk without git. It also states the approval model (reads automatic, changes wait for the owner unless set to Auto) and which actions are disabled by default, which tells the agent when a call will block.

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