Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

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

  • The core handler function for the move_file tool. Validates both source and destination paths using the validatePath utility and performs the move operation using Node.js fs.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 (string) and destination (string) paths.
    export const MoveFileArgsSchema = z.object({
      source: z.string(),
      destination: z.string(),
    });
  • src/server.ts:164-171 (registration)
    Registers the move_file tool in the MCP server's listTools response, providing name, description, and JSON schema derived from MoveFileArgsSchema.
    {
      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),
    },
  • Server-side dispatch handler for the move_file tool call. Parses input args using the schema and delegates to the moveFile function, returning a 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}` }],
      };
    }
Behavior3/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 correctly indicates this is a mutation operation (move/rename) and adds important context about the 'allowed directories' constraint. However, it doesn't disclose other behavioral aspects like error conditions, permission requirements, or whether the operation is atomic/reversible.

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 perfectly concise with three focused sentences: first states the core functionality, second elaborates on capabilities, third provides critical constraint. Every sentence adds essential information with zero 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?

For a mutation tool with no annotations and no output schema, the description provides adequate basic information about what the tool does and key constraints. However, it lacks details about return values, error conditions, and more specific behavioral expectations that would be helpful for an AI agent.

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?

With 0% schema description coverage for the 2 parameters, the description compensates well by explaining what 'source' and 'destination' represent in the context of moving/renaming operations. It clarifies that both parameters are file/directory paths and establishes their relationship (source → destination).

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 (creation only) or write_file (content modification). 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 about when to use this tool ('move or rename files and directories') and includes an important constraint ('Both source and destination must be within allowed directories'). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

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/StrawHatAI/claude-dev-tools'

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