eliminar_archivo
Delete files from your system using the DedcodeMCP File Manager. Specify the filename to remove unwanted files and manage storage.
Instructions
Elimina un archivo del sistema
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nombre | Yes | Nombre del archivo a eliminar |
Implementation Reference
- main.ts:286-312 (handler)Handler for the 'eliminar_archivo' tool. Parses input using EliminarArchivoSchema, constructs file path on desktop, validates path access, deletes the file using fs.unlink, and returns a success message or error if path invalid.
case "eliminar_archivo": { const { nombre } = EliminarArchivoSchema.parse(args); const ruta = path.join(DESKTOP_DIR, nombre); if (!validarRuta(ruta)) { return { content: [ { type: "text", text: "Error: Solo se permite acceso al escritorio", }, ], isError: true, }; } await fs.unlink(ruta); return { content: [ { type: "text", text: `Archivo eliminado: ${nombre}`, }, ], }; } - main.ts:62-64 (schema)Zod schema defining the input for 'eliminar_archivo' tool: requires 'nombre' string parameter.
const EliminarArchivoSchema = z.object({ nombre: z.string().describe("Nombre del archivo a eliminar"), }); - main.ts:138-151 (registration)Tool registration in ListToolsRequestHandler response, specifying name, description, and inputSchema matching the Zod schema.
{ name: "eliminar_archivo", description: "Elimina un archivo del sistema", inputSchema: { type: "object", properties: { nombre: { type: "string", description: "Nombre del archivo a eliminar", }, }, required: ["nombre"], }, },