Skip to main content
Glama

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 }; });

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