Skip to main content
Glama
Dedcode14

DedcodeMCP File Manager

by Dedcode14

editar_archivo

Edit the content of an existing file by overwriting it with new text using the DedcodeMCP File Manager.

Instructions

Edita el contenido de un archivo existente (sobrescribe el contenido)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nombreYesNombre del archivo a editar
nuevo_contenidoYesNuevo contenido del archivo

Implementation Reference

  • main.ts:227-254 (handler)
    Handler for the 'editar_archivo' tool: parses arguments using EditarArchivoSchema, constructs file path on desktop, validates path access, checks file existence, overwrites file with new content, and returns success message.
    case "editar_archivo": {
        const { nombre, nuevo_contenido } = EditarArchivoSchema.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.access(ruta);
        await fs.writeFile(ruta, nuevo_contenido, "utf-8");
    
        return {
            content: [
                {
                    type: "text",
                    text: `Archivo editado correctamente: ${nombre}`,
                },
            ],
        };
    }
  • main.ts:52-55 (schema)
    Zod schema defining input parameters for editar_archivo: nombre (file name) and nuevo_contenido (new content).
    const EditarArchivoSchema = z.object({
        nombre: z.string().describe("Nombre del archivo a editar"),
        nuevo_contenido: z.string().describe("Nuevo contenido del archivo"),
    });
  • main.ts:102-119 (registration)
    Tool registration in ListToolsRequestHandler: defines name, description, and inputSchema matching the EditarArchivoSchema.
    {
        name: "editar_archivo",
        description: "Edita el contenido de un archivo existente (sobrescribe el contenido)",
        inputSchema: {
            type: "object",
            properties: {
                nombre: {
                    type: "string",
                    description: "Nombre del archivo a editar",
                },
                nuevo_contenido: {
                    type: "string",
                    description: "Nuevo contenido del archivo",
                },
            },
            required: ["nombre", "nuevo_contenido"],
        },
    },
Behavior2/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 mentions 'sobrescribe el contenido' (overwrites content), indicating destructive behavior, but fails to address critical aspects like error handling (e.g., if the file doesn't exist), permission requirements, or what the response looks like (e.g., success confirmation). This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that directly states the tool's purpose and key behavior ('sobrescribe el contenido'). It is front-loaded with essential information and contains no unnecessary words, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on error conditions, permissions, response format, and how it differs from siblings beyond the basic edit action. Given the complexity and lack of structured data, more context is needed for effective use.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('nombre' as the file name and 'nuevo_contenido' as the new content). The description adds no additional semantic details beyond what the schema provides, such as file path formats or content constraints, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Edita el contenido') and target resource ('un archivo existente'), distinguishing it from siblings like crear_archivo (create) and leer_archivo (read). However, it doesn't explicitly differentiate from mover_archivo (move) or eliminar_archivo (delete) beyond the edit action, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like crear_archivo or mover_archivo, nor does it mention prerequisites such as file existence or permissions. It simply states the action without contextual usage instructions.

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

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