Skip to main content
Glama

Git Clean

git_clean

Clean untracked files from Git repositories with built-in safety controls. Preview deletions using dry-run mode, or force-remove files, directories, and ignored content.

Instructions

Remove untracked files from the working directory. Requires force flag for safety. Use dry-run to preview files that would be removed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to the Git repository. Defaults to session working directory set via git_set_working_dir..
forceNoForce the operation, bypassing safety checks.
dryRunNoPreview the operation without executing it.
directoriesNoRemove untracked directories in addition to files.
ignoredNoRemove ignored files as well.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
filesRemovedYesList of files that were removed.
directoriesRemovedYesList of directories that were removed.
dryRunYesWhether this was a dry-run (preview only).
Behavior4/5

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

While annotations indicate readOnlyHint: false, the description adds crucial behavioral context about the safety mechanism (force requirement) and preview capability (dry-run). It effectively communicates the destructive nature without contradicting the annotation.

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?

Three sentences with zero waste: purpose statement, safety constraint, and best practice. Information is front-loaded and each sentence earns its place. No redundant or vague filler.

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 the presence of an output schema and 100% parameter coverage in the schema, the description appropriately focuses on safety-critical behavioral aspects (force/dry-run) rather than repeating schema details. Could be improved by briefly noting the directories/ignored modifiers, but adequate for safe usage.

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?

With 100% schema coverage, the baseline is 3. The description adds value by explaining the semantic purpose of force ('for safety') and dryRun ('preview files that would be removed'), framing the technical schema descriptions in user-centric safety terms.

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 a specific verb ('Remove') and clear resource ('untracked files from the working directory'), immediately distinguishing it from sibling tools like git_status (viewing) or git_reset (affecting tracked files). The scope is precisely bounded to the working directory.

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?

Provides clear safety guidance ('Requires force flag for safety') and workflow recommendation ('Use dry-run to preview'), which effectively guides safe invocation. However, it lacks explicit comparison to alternatives (e.g., when to use git_add instead to preserve files).

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/cyanheads/git-mcp-server'

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