Skip to main content
Glama
alxspiker

MCP Server for FTP Access

create-directory

Create new directories on FTP servers by specifying remote paths, enabling organized file management through structured folder creation.

Instructions

Create a new directory on the FTP server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remotePathYesPath of the directory to create

Implementation Reference

  • The handler function that executes the create-directory tool logic: calls ftpClient.createDirectory(remotePath) and returns formatted text response or error.
    async ({ remotePath }) => {
      try {
        await ftpClient.createDirectory(remotePath);
        
        return {
          content: [
            {
              type: "text",
              text: `Directory successfully created at ${remotePath}`
            }
          ]
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error creating directory: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod input schema for the create-directory tool defining the remotePath parameter.
    {
      remotePath: z.string().describe("Path of the directory to create"),
    },
  • src/index.ts:133-163 (registration)
    Registration of the create-directory tool with the MCP server using server.tool().
    server.tool(
      "create-directory",
      "Create a new directory on the FTP server",
      {
        remotePath: z.string().describe("Path of the directory to create"),
      },
      async ({ remotePath }) => {
        try {
          await ftpClient.createDirectory(remotePath);
          
          return {
            content: [
              {
                type: "text",
                text: `Directory successfully created at ${remotePath}`
              }
            ]
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error creating directory: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Supporting FtpClient method that performs the actual directory creation using basic-ftp's ensureDir.
    async createDirectory(remotePath: string): Promise<boolean> {
      try {
        await this.connect();
        await this.client.ensureDir(remotePath);
        await this.disconnect();
        return true;
      } catch (error) {
        console.error("Create directory error:", error);
        throw new Error(`Failed to create directory: ${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 but only states the basic action. It doesn't disclose behavioral traits like whether it requires authentication, what happens on failure (e.g., if path is invalid), if it creates parent directories recursively, or any rate limits. 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 without any wasted words. It's appropriately sized 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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't cover important context like error conditions, permissions needed, whether the operation is idempotent, or what happens on success. Given the complexity of file system operations, more behavioral disclosure 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?

The schema description coverage is 100% with the single parameter 'remotePath' well-documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides, 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 ('Create') and resource ('new directory on the FTP server'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list-directory' or 'upload-file' beyond the obvious creation vs. listing/uploading distinction.

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. It doesn't mention prerequisites (e.g., needing proper permissions), when not to use it (e.g., if directory already exists), or how it relates to siblings like 'delete-directory' or 'list-directory'.

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