Skip to main content
Glama

ddflow_cleanup

Categorizes worktrees and branches by merge and dirty state, reports cleanup options, and can safely remove merged worktrees and branches without touching dirty worktrees.

Instructions

Classify every ddflow worktree and branch: merged (safe to remove), unmerged (carries commits nobody landed), dirty (uncommitted edits — a human looks), orphan, or stale branch. Reports by default; with apply=true it removes merged worktrees and branches and lands commits for items the queue already considers done. A dirty tree is NEVER touched automatically, whatever you pass — it is the only thing here that exists nowhere else.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applyNoPerform the safe actions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations to rely on, the description carries the full disclosure burden and succeeds: it reveals that apply=true removes merged worktrees/branches, lands commits for queue-done items, and that dirty trees are never modified regardless of apply. This goes well beyond the schema by detailing side effects and the key safety boundary.

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?

Four sentences, each earning its place: classification categories, default report mode, apply behavior, and the dirty-tree safety warning. The most important information is front-loaded, and there is no filler or repetition of the schema.

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 gives a full picture for a one-parameter tool with no output schema: categories, default behavior, apply semantics, and a critical safety exception. Minor gaps remain — 'orphan' and 'stale branch' are not formally defined, and 'lands commits' references an internal queue concept — but these do not prevent an agent from invoking the tool correctly or understanding its effects.

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?

The schema already describes apply as 'Perform the safe actions' with 100% coverage, so the baseline is 3. The description adds value by explaining what those safe actions actually are (removing merged items and landing done commits) and by clarifying that the default is a report-only run when apply is not true. This is useful enrichment beyond the schema.

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 names a specific action (classify every ddflow worktree and branch), enumerates the classification categories (merged, unmerged, dirty, orphan, stale), and states the two operational modes: report by default and remove with apply=true. This clearly differentiates it from sibling tools as a cleanup/analysis utility.

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?

It clearly states the default behavior (reports) and when to use apply=true to perform removals, plus an explicit exclusion: dirty trees are never touched automatically. It does not name alternative sibling tools or state when NOT to use this tool in favor of another, but the usage context is still clear for an agent.

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