Skip to main content
Glama

delete_directory

Deletes a directory and optionally all its contents. For files or uncertain paths, use the 'delete' tool instead.

Instructions

Delete a directory and optionally all its contents. Only works on directories, not files. Use 'delete' tool if you're unsure whether the path is a file or directory. / 删除目录及其所有内容。仅用于删除目录,不能删除文件。如果不确定是文件还是目录,请使用 delete 工具。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path of the directory to delete. Must be a directory, not a file.
recursiveNoWhether to recursively delete all subdirectories and files. Default is true. Set to false to only delete empty directories.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
successYes
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the directory-only constraint and the optional recursive behavior, but it does not explicitly state that deletion is permanent, irreversible, or that recursive=true is the default. For a destructive operation, more explicit caution would improve transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The English portion is concise and front-loaded, but the Chinese translation duplicates the English content without adding information. This redundancy means the description isn't as tight as it could be, though it remains short overall.

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 simple two-parameter tool, 100% schema coverage, and existence of an output schema, the description covers the essential use cases and constraints. It could mention the permanent nature of deletion or the default recursive behavior, but those are partially implied by the tool name and schema, so the description is fairly complete.

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%, and the description does not add meaningful parameter-specific details beyond what the schema already provides. The phrase 'optionally all its contents' paraphrases the recursive parameter but adds no new semantics; the schema already explains defaults and behavior.

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's function: 'Delete a directory and optionally all its contents.' It specifies the resource (directory) and distinguishes it from file deletion by noting 'Only works on directories, not files.' The reference to the 'delete' tool for ambiguous paths further clarifies its scope relative to siblings.

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?

The description provides explicit guidance: 'Only works on directories, not files' and 'Use ‘delete’ tool if you’re unsure whether the path is a file or directory.' This tells the agent exactly when to choose this tool over the generic delete tool, satisfying the need for usage context.

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/shibingli/mcp-toolkit'

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