Skip to main content
Glama

discard_worktree

Safely discard an abandoned git worktree by removing it and its branch, then archiving the status as discarded. Ideal for rejected or abandoned subgoals.

Instructions

v1.0.0: Discard an isolated git worktree safely. Removes the worktree (git worktree remove --force), deletes its branch, and archives status as 'discarded'. Use when a subgoal is rejected or abandoned. All paths pass guardWorkspacePath + sensitiveGuard.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesMain workspace repository path inside workspaceRoot.
worktree_idYesWorktree ID (wt_...) to discard.
Behavior4/5

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

With no annotations, the description discloses key behaviors: forceful removal, branch deletion, status archiving, and safety guards. It could be more explicit about irreversibility, but the information is reasonably transparent for a mutation tool.

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?

Very concise: three sentences cover purpose, actions, usage, and safety. No unnecessary words, front-loaded with key 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?

Given no output schema and minimal annotations, the description covers purpose, usage, and safety. It lacks error conditions or permissions, but is complete enough for a straightforward discard operation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already explains parameters. The description adds a safety note about guards but no additional semantic meaning beyond what is in the schema. Baseline score of 3 is appropriate.

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 clearly states the tool discards an isolated git worktree, specifying the actions (removes worktree, deletes branch, archives status) and distinguishes it from sibling tools like merge_worktree. The verb 'discard' and resource 'isolated git worktree' are specific and unambiguous.

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 states 'Use when a subgoal is rejected or abandoned,' providing clear context. While it does not list alternatives or when not to use, the usage guidance is sufficient for the intended scenario.

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/jiezeng2004-design/PatchWarden'

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