Skip to main content
Glama
alxspiker

MCP Server for FTP Access

delete-file

Remove files from an FTP server by specifying the remote file path. This tool helps manage storage and clean up unnecessary files on FTP servers.

Instructions

Delete a file from the FTP server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remotePathYesPath of the file to delete

Implementation Reference

  • src/index.ts:166-196 (registration)
    Registers the MCP 'delete-file' tool with Zod input schema for remotePath and an async handler that calls ftpClient.deleteFile(remotePath), handles success/error responses with markdown text content.
    server.tool(
      "delete-file",
      "Delete a file from the FTP server",
      {
        remotePath: z.string().describe("Path of the file to delete"),
      },
      async ({ remotePath }) => {
        try {
          await ftpClient.deleteFile(remotePath);
          
          return {
            content: [
              {
                type: "text",
                text: `File successfully deleted from ${remotePath}`
              }
            ]
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error deleting file: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Core implementation of file deletion in FtpClient class: connects to FTP server, calls basic-ftp Client.remove(remotePath) to delete the file, disconnects, and propagates errors.
    async deleteFile(remotePath: string): Promise<boolean> {
      try {
        await this.connect();
        await this.client.remove(remotePath);
        await this.disconnect();
        return true;
      } catch (error) {
        console.error("Delete file error:", error);
        throw new Error(`Failed to delete file: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action is destructive ('Delete') but doesn't mention permanence, error conditions, permissions required, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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 communicates the core purpose without unnecessary words. It's appropriately sized for a simple tool and front-loaded with the essential information.

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 doesn't explain what happens after deletion, error handling, authentication requirements, or return values. Given the complexity and lack of structured data, more behavioral context is needed.

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?

Schema description coverage is 100% (the 'remotePath' parameter is fully documented in the schema), so the baseline is 3. The description doesn't add any parameter-specific information beyond what the schema already provides about the file path.

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 ('Delete') and resource ('a file from the FTP server'), making the purpose immediately understandable. It distinguishes from siblings like 'delete-directory' by specifying 'file' rather than 'directory', but doesn't explicitly contrast with other deletion operations.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., file must exist), when not to use it (e.g., for directories), or suggest alternatives like 'delete-directory' for different resource types.

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/alxspiker/mcp-server-ftp'

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