Skip to main content
Glama

mover_archivo

Move or rename files by specifying source and destination paths to organize your file system.

Instructions

Mueve o renombra un archivo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
origenYesRuta/nombre del archivo origen
destinoYesRuta/nombre del archivo destino

Implementation Reference

  • main.ts:256-284 (handler)
    The switch case handler for 'mover_archivo' that parses arguments using the schema, validates paths restricted to desktop, creates destination directory if needed, renames the file using fs.rename, and returns success or error message.
    case "mover_archivo": { const { origen, destino } = MoverArchivoSchema.parse(args); const rutaOrigen = path.join(DESKTOP_DIR, origen); const rutaDestino = path.join(DESKTOP_DIR, destino); if (!validarRuta(rutaOrigen) || !validarRuta(rutaDestino)) { return { content: [ { type: "text", text: "Error: Solo se permite acceso al escritorio", }, ], isError: true, }; } await fs.mkdir(path.dirname(rutaDestino), { recursive: true }); await fs.rename(rutaOrigen, rutaDestino); return { content: [ { type: "text", text: `Archivo movido o renombrado: ${origen} a ${destino}`, }, ], }; }
  • main.ts:57-60 (schema)
    Zod schema defining input parameters 'origen' and 'destino' for the mover_archivo tool.
    const MoverArchivoSchema = z.object({ origen: z.string().describe("Ruta/nombre del archivo origen"), destino: z.string().describe("Ruta/nombre del archivo destino"), });
  • main.ts:120-137 (registration)
    Tool registration in the ListTools response, including name, description, and inputSchema matching the Zod schema.
    { name: "mover_archivo", description: "Mueve o renombra un archivo", inputSchema: { type: "object", properties: { origen: { type: "string", description: "Ruta/nombre del archivo origen", }, destino: { type: "string", description: "Ruta/nombre del archivo destino", }, }, required: ["origen", "destino"], }, },

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/Dedcode14/DedcodeMCP'

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