Skip to main content
Glama
masx200
by masx200

webdav_create_remote_directory

Create a new directory on a remote WebDAV server by specifying the desired path for organized file storage and management.

Instructions

Create a new directory on a remote WebDAV server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Tool handler registration, schema, and execution logic for webdav_create_remote_directory. Calls webdavService.createDirectory and handles success/error responses.
    server.tool(
      "webdav_create_remote_directory",
      "Create a new directory on a remote WebDAV server",
      {
        path: z.string().min(1, "Path must not be empty"),
      },
      async ({ path }) => {
        try {
          await webdavService.createDirectory(path);
    
          return {
            content: [{
              type: "text",
              text: `Directory created successfully at ${path}`,
            }],
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error creating directory: ${(error as Error).message}`,
            }],
            isError: true,
          };
        }
      },
    );
  • Core implementation of directory creation in WebDAVService using WebDAVClient.createDirectory, with full path normalization, result checking, and error handling.
    async createDirectory(path: string): Promise<void> {
      const fullPath = this.getFullPath(path);
      logger.debug(`Creating directory: ${fullPath}`);
    
      try {
        // createDirectory in v5.x returns a boolean indicating success
        const result = await this.client.createDirectory(fullPath);
    
        // Check result based on type
        if (typeof result === "boolean" && !result) {
          throw new Error(
            "Failed to create directory: server returned failure status",
          );
        } else if (
          this.isResponseData(result) &&
          result.status !== undefined &&
          result.status !== 201 &&
          result.status !== 204
        ) {
          throw new Error(
            `Failed to create directory: server returned status ${result.status}`,
          );
        }
    
        logger.debug(`Successfully created directory: ${fullPath}`);
      } catch (error) {
        logger.error(`Error creating directory ${fullPath}:`, error);
        throw new Error(
          `Failed to create directory: ${(error as Error).message}`,
        );
      }
    }
  • Prompt schema and template registration for webdav_create_remote_directory, defining input validation and user message generation.
      // Prompt for creating a directory
      server.prompt(
        "webdav_create_remote_directory",
        {
          path: z.string().min(1, "Path must not be empty"),
        },
        (args) => ({
          messages: [
            {
              role: "user",
              content: {
                type: "text",
                text:
                  `Create a new directory on the remote WebDAV server at path "${args.path}".
    
    Please execute this remote WebDAV operation and confirm when the directory has been created.`,
              },
            },
          ],
        }),
      );
Behavior2/5

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

With no annotations, the description carries the full burden but only states the basic action. It doesn't disclose behavioral traits such as required permissions (e.g., write access), whether it overwrites existing directories, error handling (e.g., if path already exists), or side effects. 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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to scan and understand quickly. Every word earns its place by conveying 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?

Given the complexity of a mutation tool with no annotations, no output schema, and low parameter coverage, the description is incomplete. It lacks details on behavior, parameters, and expected outcomes, leaving significant gaps for an AI agent to infer correctly. More context is needed for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, and the tool description adds no information about the 'path' parameter. It doesn't explain what the path represents (e.g., absolute or relative), format expectations, or constraints beyond the schema's minLength. This fails to compensate for the low 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 a remote WebDAV server'), distinguishing it from siblings like 'webdav_create_remote_file' (creates files) and 'webdav_get_directory_tree' (reads directories). However, it doesn't specify if it's a single directory or can create nested paths, which would make it fully specific.

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 on when to use this tool versus alternatives. For example, it doesn't mention if it should be used for initial setup versus adding subdirectories, or how it differs from 'webdav_move_remote_item' for reorganizing directories. The description only states what it does, not when to apply it.

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/masx200/mcp-webdav-server'

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