Skip to main content
Glama
koopatroopa787

MCP PC Control Server

delete_directory

Remove a directory and all its contents permanently using this recursive deletion tool. Exercise caution as this action cannot be undone.

Instructions

Permanently delete a directory and all of its contents, including all files and subdirectories. This is a recursive operation that cannot be undone. Use with extreme caution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to the directory to delete

Implementation Reference

  • The switch case handler that executes the delete_directory tool by recursively removing the directory and all contents using fs.rm with recursive and force options.
    case "delete_directory": {
      const dirPath = args.path as string;
      await fs.rm(dirPath, { recursive: true, force: true });
      return {
        content: [
          {
            type: "text",
            text: `Successfully deleted directory ${dirPath}`,
          },
        ],
      };
    }
  • The tool definition in the TOOLS array, including name, description, and inputSchema for validating the 'path' parameter.
    {
      name: "delete_directory",
      description: "Permanently delete a directory and all of its contents, including all files and subdirectories. This is a recursive operation that cannot be undone. Use with extreme caution.",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "The path to the directory to delete",
          },
        },
        required: ["path"],
      },
    },
  • src/index.ts:261-263 (registration)
    The server request handler for ListToolsRequestSchema that returns the TOOLS array, registering delete_directory among available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: TOOLS };
    });
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: the operation is permanent and irreversible ('cannot be undone'), recursive ('all of its contents, including all files and subdirectories'), and high-risk ('Use with extreme caution'). However, it doesn't mention potential errors (e.g., if the path doesn't exist), permissions required, or system-specific constraints.

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?

The description is front-loaded with the core action and scope in the first sentence, followed by critical warnings. Every sentence earns its place: the first defines the operation, the second emphasizes irreversibility, and the third advises caution. It's appropriately sized without redundancy or fluff.

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 tool's high complexity (destructive, recursive operation) and lack of annotations or output schema, the description does a good job covering essential context: purpose, scope, and risks. However, it could be more complete by mentioning error handling, permissions, or system limits, which are important for such a critical tool.

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?

The input schema has 100% description coverage, with the 'path' parameter clearly documented. The description adds no additional parameter semantics beyond what the schema provides, such as path format examples or validation rules. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 specific action ('permanently delete'), the target resource ('a directory and all of its contents'), and distinguishes it from sibling tools like 'delete_file' (which only deletes individual files) and 'create_directory' (which creates rather than deletes). The phrase 'recursive operation' further clarifies the scope beyond just the directory itself.

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 explicitly provides usage guidance with 'Use with extreme caution' and 'cannot be undone,' indicating when to use this tool (for irreversible deletion) versus alternatives like 'delete_file' for single files or 'move_file' for relocation. It effectively warns against casual use, though it doesn't name specific alternatives.

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/koopatroopa787/first_mcp'

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