Skip to main content
Glama

crear_archivo

Create new files with specified names and content through the DedcodeMCP File Manager server to manage desktop files.

Instructions

Crea un archivo nuevo en el sistema

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nombreYesNombre del archivo con extensión
contenidoYesEl contenido del archivo

Implementation Reference

  • main.ts:170-197 (handler)
    Handler for crear_archivo tool: parses args using schema, validates path restricted to desktop, creates directory if needed, writes file content, returns success or error message.
    case "crear_archivo": { const { nombre, contenido } = CrearArchivoSchema.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.mkdir(path.dirname(ruta), { recursive: true }); await fs.writeFile(ruta, contenido, "utf-8"); return { content: [ { type: "text", text: `Archivo creado exitosamente: ${nombre}`, }, ], }; }
  • main.ts:43-46 (schema)
    Zod schema for input validation of crear_archivo tool: requires nombre (filename with extension) and contenido (file content).
    const CrearArchivoSchema = z.object({ nombre: z.string().describe("Nombre del archivo con extensión"), contenido: z.string().describe("El contenido del archivo"), });
  • main.ts:70-87 (registration)
    Registration of crear_archivo tool in the listTools response, including name, description, and input schema matching the Zod schema.
    { name: "crear_archivo", description: "Crea un archivo nuevo en el sistema", inputSchema: { type: "object", properties: { nombre: { type: "string", description: "Nombre del archivo con extensión", }, contenido: { type: "string", description: "El contenido del archivo", }, }, required: ["nombre", "contenido"], }, },

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