Skip to main content
Glama
MrGNSS

Desktop Commander MCP

move_file

Move or rename files and directories within allowed paths. Specify source and destination to transfer files between locations or rename them in one operation.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
destinationYes

Implementation Reference

  • Core implementation of the move_file tool handler. Validates source and destination paths then renames the file using Node.js fs.promises.rename.
    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);
    }
  • Zod schema defining the input arguments for the move_file tool: source and destination paths.
    export const MoveFileArgsSchema = z.object({
      source: z.string(),
      destination: z.string(),
    });
  • src/server.ts:164-171 (registration)
    Tool registration in the listTools handler, specifying name, description, and input schema for move_file.
    {
      name: "move_file",
      description:
        "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.",
      inputSchema: zodToJsonSchema(MoveFileArgsSchema),
    },
  • Dispatcher case in the CallToolRequest handler that parses arguments, calls the moveFile function, and returns success message.
    case "move_file": {
      const parsed = MoveFileArgsSchema.parse(args);
      await moveFile(parsed.source, parsed.destination);
      return {
        content: [{ type: "text", text: `Successfully moved ${parsed.source} to ${parsed.destination}` }],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the constraint about allowed directories, it lacks details on permissions, error handling, whether the operation is atomic or reversible, or what happens if the destination exists. For a mutation tool with zero annotation coverage, this is insufficient.

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 appropriately sized with three concise sentences that are front-loaded with the core purpose. Each sentence adds value: the first states the action, the second clarifies the dual functionality, and the third adds a critical constraint, with no wasted words.

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

Completeness3/5

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

Given the tool's complexity (mutation operation), lack of annotations, and no output schema, the description is moderately complete. It covers the basic purpose and a key constraint but misses behavioral details like permissions, error cases, and return values. This is adequate but has clear gaps for a tool with 2 parameters and no structured support.

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 schema provides no parameter details. The description adds some meaning by explaining that source and destination are used for moving/renaming within allowed directories, but it does not specify format requirements (e.g., path syntax) or examples. This partially compensates but leaves gaps.

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 tool's purpose with specific verbs ('move or rename') and resources ('files and directories'), distinguishing it from siblings like create_directory, read_file, and write_file. It explicitly mentions the dual functionality of moving between directories and renaming in one operation.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('move or rename files and directories') and includes a constraint ('Both source and destination must be within allowed directories'), but it does not explicitly mention when not to use it or name specific alternatives among siblings like create_directory or write_file.

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/MrGNSS/ClaudeDesktopCommander'

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