Skip to main content
Glama
LaubPlusCo

WebDAV MCP Server

by LaubPlusCo

webdav_create_remote_directory

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

Instructions

Create a new directory on a remote WebDAV server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP server.tool registration for 'webdav_create_remote_directory', including description, input schema, and inline async handler function that executes the logic.
    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
          };
        }
      }
    );
  • Zod input schema validation for the tool parameters.
    {
      path: z.string().min(1, 'Path must not be empty')
    },
  • Inline handler function that performs input destructuring, calls the service, handles errors, and formats MCP response.
    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
        };
      }
    }
  • Supporting WebDAVService method implementing directory creation using the underlying WebDAV client, with path normalization, logging, error handling, and result validation.
    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}`);
      }
    }
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 ('Create') which implies a write/mutation operation, but doesn't disclose any behavioral traits such as required permissions, whether it's idempotent (e.g., fails if directory exists), what happens on success/failure, or any rate limits. The description is minimal and lacks crucial operational context.

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, well-structured sentence that efficiently conveys the core purpose without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information ('Create a new directory'). Every word earns its place.

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 tool's complexity (a write operation with 1 parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, parameter details, error conditions, or return values. For a mutation tool with zero annotation coverage, this minimal description leaves significant gaps in understanding how to use it effectively.

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, so the description must compensate. It mentions 'path' implicitly through 'directory on a remote WebDAV server', but doesn't explain what the 'path' parameter represents (e.g., absolute vs relative, format expectations like leading slash, or parent directory requirements). This adds minimal semantic value beyond the schema's basic structure.

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'), making the purpose immediately understandable. It distinguishes from siblings like 'webdav_create_remote_file' by specifying 'directory' instead of 'file', but doesn't explicitly differentiate from other directory-related tools like 'webdav_list_remote_directory' beyond the action verb.

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 (like authentication or existing parent directories), when not to use it (e.g., if the directory already exists), or suggest alternatives like 'webdav_move_remote_item' for reorganizing directories. The context is implied but not explicit.

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

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