Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

move_file

Move or rename files and directories within allowed paths using absolute paths for reliable operation. Simplify file management with a single action for both tasks.

Instructions

                    Move or rename files and directories.
                    
                    Can move files between directories and rename them in a single operation.
                    Both source and destination must be within allowed directories.
                    
                    IMPORTANT: Always use absolute paths for reliability. Paths are automatically normalized regardless of slash direction. Relative paths may fail as they depend on the current working directory. Tilde paths (~/...) might not work in all contexts. Unless the user explicitly asks for relative paths, use absolute paths.
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationYes
sourceYes

Implementation Reference

  • The main handler function for the 'move_file' tool. It validates input arguments using MoveFileArgsSchema, calls the moveFile helper function, and returns a success message or error response.
    export async function handleMoveFile(args: unknown): Promise<ServerResult> {
        try {
            const parsed = MoveFileArgsSchema.parse(args);
            await moveFile(parsed.source, parsed.destination);
            return {
                content: [{ type: "text", text: `Successfully moved ${parsed.source} to ${parsed.destination}` }],
            };
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            return createErrorResponse(errorMessage);
        }
    }
  • Zod schema defining the input parameters for the move_file tool: source path and destination path.
    export const MoveFileArgsSchema = z.object({
      source: z.string(),
      destination: z.string(),
    });
  • Core helper function that performs the actual file move operation using fs.rename after path validation.
    export async function moveFile(sourcePath: string, destinationPath: string): Promise<void> {
        const validSourcePath = await validatePath(sourcePath);
        const validDestPath = await validatePath(destinationPath);
        await fs.rename(validSourcePath, validDestPath);
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool can move or rename in one operation, both source and destination must be within allowed directories, and it requires absolute paths for reliability. It also mentions path normalization and limitations with relative/tilde paths. However, it lacks details on error handling or permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose. Most sentences add value, such as operational details and path guidelines. However, the final sentence about referencing as 'DC:' is slightly extraneous and could be trimmed for better conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does a good job covering the tool's purpose, usage, and parameters. It addresses key contextual aspects like path requirements and operational scope. However, it lacks details on return values, error conditions, or side effects, which would enhance completeness for a mutation tool.

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

Parameters4/5

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

The input schema has 0% description coverage, so the description must compensate. It adds significant meaning: 'source' and 'destination' are clarified as paths for files/directories, with constraints like requiring absolute paths and being within allowed directories. It also explains that the operation handles both moving and renaming. This goes well beyond the bare schema, though it could specify path formats more precisely.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('move or rename') and resource ('files and directories'), and distinguishes from siblings like 'create_directory' (creation), 'read_file' (reading), and 'write_file' (writing). It specifies the operation can handle both moving between directories and renaming in one action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool: for moving or renaming files/directories. It provides clear alternatives by naming sibling tools for different operations (e.g., 'create_directory' for creation, 'read_file' for reading). It also includes usage notes about path requirements, making it highly actionable.

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

Related 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/wonderwhy-er/DesktopCommanderMCP'

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