Skip to main content
Glama
koopatroopa787

MCP PC Control Server

delete_file

Permanently delete files from your computer's file system. This action removes files immediately and cannot be undone, providing direct file management through PC control capabilities.

Instructions

Permanently delete a file from the file system. This operation cannot be undone. The file is immediately removed from the storage device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path to the file to delete

Implementation Reference

  • The switch case handler for the 'delete_file' tool. It extracts the file path from arguments, deletes the file using fs.unlink (Node.js promise-based unlink), and returns a success message in the expected MCP content format.
    case "delete_file": {
      const filePath = args.path as string;
      await fs.unlink(filePath);
      return {
        content: [
          {
            type: "text",
            text: `Successfully deleted file ${filePath}`,
          },
        ],
      };
    }
  • The schema definition for the 'delete_file' tool, including name, description, and inputSchema specifying a required 'path' string parameter for MCP tool validation.
    {
      name: "delete_file",
      description: "Permanently delete a file from the file system. This operation cannot be undone. The file is immediately removed from the storage device.",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "The path to the file to delete",
          },
        },
        required: ["path"],
      },
    },
  • src/index.ts:261-263 (registration)
    The registration handler for listing tools, which returns the TOOLS array containing the 'delete_file' tool definition.
    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 ('cannot be undone') and immediate ('immediately removed'), which are critical for a destructive action. It lacks details on error handling (e.g., if the file doesn't exist) or permissions required, but covers the core behavioral impact well.

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 purpose in the first sentence, followed by critical behavioral warnings. Both sentences earn their place by conveying essential information without redundancy, making it efficient and well-structured for quick comprehension.

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?

For a destructive tool with no annotations and no output schema, the description is reasonably complete: it explains the action, permanence, and immediacy. It could improve by mentioning error cases or return values, but given the simplicity (one parameter, high schema coverage), it provides sufficient context for safe usage.

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%, with the parameter 'path' clearly documented in the schema. The description does not add any additional meaning or context about the parameter beyond what the schema provides (e.g., path format or constraints), so it meets the baseline for high schema coverage without extra value.

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') and resource ('a file from the file system'), distinguishing it from sibling tools like delete_directory (which targets directories) or move_file (which relocates rather than removes). The verb+resource combination is precise 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?

The description implies usage context through the warning 'cannot be undone,' suggesting it should be used cautiously for irreversible deletions. However, it does not explicitly state when to use this versus alternatives like move_file (for relocation) or edit_file (for modification), nor does it mention prerequisites like file existence or permissions.

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