Skip to main content
Glama

Git stash

git_stash

Pause work by stashing tracked or untracked changes, then list, show, apply, pop, or drop stashes to switch branches or commit selectively.

Instructions

Stash push/list/apply/pop/drop/show. Push stashes staged+unstaged tracked changes (add include_untracked=true for untracked files). Use when: you need to pause work to switch branches or commit selectively. Avoid when: you need to stash and keep a copy (stash keeps one; use apply over pop) or drop permanently (prefer apply, then commit). Output: push: pushed, message, selector, output. list: entries[] {selector, sha, subject}, count. apply/pop/drop: applied/dropped. show: files[], count.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "git_stash"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsNoOptional workspace-relative paths to limit what gets stashed.
actionNopush: stash changes; list: list stashes; apply/pop/drop: apply/pop/drop a stash; show: list files in a stash.list
reasonNoOptional why (max 400 chars), audit-logged.
messageNoOptional message for action=push.
selectorNoStash selector (default stash@{0}); format stash@{N}.
include_untrackedNotrue includes untracked files when pushing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.5.0
    • removedInput schema / properties / include_untracked / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_untracked / description
      Previous value: -"1 includes untracked files when pushing."New value: +"true includes untracked files when pushing."
    • removedInput schema / properties / include_untracked / maximum
      Removed value: -1
    • removedInput schema / properties / include_untracked / minimum
      Removed value: -0
    • changedInput schema / properties / include_untracked / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the annotations (readOnly=false, destructiveHint=false, idempotent=false), it discloses which changes get captured, the untracked opt-in, the pop/apply copy semantics, and the per-action output fields. One tension is left unflagged: it says drop removes a stash permanently while destructiveHint is false, so the agent must reconcile that itself. Error behavior and selector scoping (e.g., whether stashes are per-workspace) are also unstated.

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 the action list, then cleanly partitioned into 'Use when', 'Avoid when', and 'Output' segments. Every sentence carries decision-relevant information with no restatement of the name or filler.

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?

There is no output schema, and the description compensates by enumerating the return shape for each action (pushed/message/selector, entries[] and count, applied/dropped, files[] and count). With six documented parameters and zero required, an agent has everything needed to call it correctly.

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 the baseline is 3, but the description adds real decision semantics on top of the schema: what push captures by default versus with include_untracked, and the pop-versus-apply tradeoff that governs which action value to pick. It does not add syntax detail for selector or paths, which the schema already carries.

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 the specific resource and every operation it covers (push/list/apply/pop/drop/show), so an agent knows exactly which git operation each action performs. It also states what push actually stashes (staged + unstaged tracked changes, untracked only with include_untracked=true), which distinguishes it from siblings like git_commit and git_status without opening any schema.

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?

It provides an explicit 'Use when' (pausing work to switch branches, committing selectively) and an explicit 'Avoid when' that names the correct alternative behavior (use apply over pop when you want to keep a copy; prefer apply-then-commit over drop). The apply-vs-pop choice is spelled out rather than left to inference.

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