Skip to main content
Glama
LaubPlusCo

WebDAV MCP Server

by LaubPlusCo

webdav_move_remote_item

Move or rename files and directories on a remote WebDAV server by specifying source and destination paths, with optional overwrite control.

Instructions

Move or rename a file or directory on a remote WebDAV server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromPathYes
toPathYes
overwriteNo

Implementation Reference

  • Registers the 'webdav_move_remote_item' tool with input schema validation and execution handler that performs existence checks and calls webdavService.move()
    server.tool(
      'webdav_move_remote_item',
      'Move or rename a file or directory on a remote WebDAV server',
      {
        fromPath: z.string().min(1, 'Source path must not be empty'),
        toPath: z.string().min(1, 'Destination path must not be empty'),
        overwrite: z.boolean().optional().default(false)
      },
      async ({ fromPath, toPath, overwrite }) => {
        try {
          // Check if source exists
          const sourceExists = await webdavService.exists(fromPath);
          if (!sourceExists) {
            return {
              content: [{
                type: 'text',
                text: `Error: Source path does not exist at ${fromPath}`
              }],
              isError: true
            };
          }
    
          // Check if destination exists and respect overwrite flag
          const destExists = await webdavService.exists(toPath);
          if (destExists && !overwrite) {
            return {
              content: [{
                type: 'text',
                text: `Error: Destination already exists at ${toPath}. Use overwrite=true to replace it.`
              }],
              isError: true
            };
          }
    
          await webdavService.move(fromPath, toPath);
          
          return {
            content: [{
              type: 'text',
              text: `Successfully moved ${fromPath} to ${toPath}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `Error moving: ${(error as Error).message}`
            }],
            isError: true
          };
        }
      }
    );
  • Implements the move operation in WebDAVService by calling WebDAVClient.moveFile with path normalization and error handling
    async move(fromPath: string, toPath: string): Promise<void> {
      const fullFromPath = this.getFullPath(fromPath);
      const fullToPath = this.getFullPath(toPath);
      logger.debug(`Moving from ${fullFromPath} to ${fullToPath}`);
      
      try {
        // Get type before moving for better logging
        const stat = await this.stat(fromPath).catch(() => null);
        const itemType = stat?.type || 'item';
        
        // moveFile in v5.x returns a boolean indicating success
        const result = await this.client.moveFile(fullFromPath, fullToPath);
        
        // Check result based on type
        if (typeof result === 'boolean' && !result) {
          throw new Error("Failed to move: server returned failure status");
        } else if (this.isResponseData(result) && 
                   result.status !== undefined && 
                   result.status !== 201 && 
                   result.status !== 204) {
          throw new Error(`Failed to move: server returned status ${result.status}`);
        }
        
        logger.debug(`Successfully moved ${itemType} from ${fullFromPath} to ${fullToPath}`);
      } catch (error) {
        logger.error(`Error moving from ${fullFromPath} to ${fullToPath}:`, error);
        throw new Error(`Failed to move: ${(error as Error).message}`);
      }
    }
  • src/lib.ts:77-79 (registration)
    Top-level server setup calls setupToolHandlers(server, webdavService) which registers the webdav_move_remote_item tool among others
    setupResourceHandlers(server, webdavService);
    setupToolHandlers(server, webdavService);
    setupPromptHandlers(server);
  • Input schema for the webdav_move_remote_item tool using Zod validation
      fromPath: z.string().min(1, 'Source path must not be empty'),
      toPath: z.string().min(1, 'Destination path must not be empty'),
      overwrite: z.boolean().optional().default(false)
    },
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 mentions the action (move/rename) but doesn't describe what happens on conflicts (though the 'overwrite' parameter hints at this), whether the operation is atomic, what permissions are required, error conditions, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 front-loads the core action and resource. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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 this is a mutation tool with no annotations, 3 parameters (0% schema coverage), no output schema, and multiple sibling tools, the description is inadequate. It doesn't explain behavioral traits, parameter details, error handling, or differentiation from alternatives, leaving the agent with insufficient context for reliable 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?

Schema description coverage is 0%, so the description must compensate. It implies 'fromPath' and 'toPath' parameters through 'Move or rename a file or directory' but doesn't explain path formats, what 'overwrite' does, or any constraints. The description adds minimal value beyond what's inferable from parameter names, leaving most semantics undocumented.

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 ('Move or rename') and resource ('a file or directory on a remote WebDAV server'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'webdav_copy_remote_item' (which copies rather than moves) or 'webdav_update_remote_file' (which might modify content rather than location/name).

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 when to choose move vs. copy (webdav_copy_remote_item), when renaming is appropriate, or any prerequisites like authentication or server connectivity. The agent must infer usage from the tool name alone.

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