Skip to main content
Glama

move_path

Move or rename a file or directory by providing a source and destination path. Optionally set a workspace root for context.

Instructions

Move or rename a file or directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource path
destinationYesDestination path
workspace_rootNoWorkspace root directory (optional)

Implementation Reference

  • Handler for the 'move_path' tool. Resolves source and destination paths using resolveWorkspacePath, ensures the destination directory exists via mkdir with recursive:true, then uses rename() from fs/promises to move/rename the file or directory. Returns a confirmation message with source and destination paths.
    case "move_path": {
      const src = resolveWorkspacePath(a.source as string, a.workspace_root as string | undefined);
      const dst = resolveWorkspacePath(a.destination as string, a.workspace_root as string | undefined);
      await mkdir(dirname(dst), { recursive: true });
      await rename(src, dst);
      return { content: [{ type: "text", text: `Moved: ${src} → ${dst}` }] };
    }
  • Schema definition for 'move_path' tool. Defines inputSchema with three properties: 'source' (string, required), 'destination' (string, required), and 'workspace_root' (string, optional). The tool is described as 'Move or rename a file or directory.'
      name: "move_path",
      description: "Move or rename a file or directory.",
      inputSchema: {
        type: "object",
        properties: {
          source: { type: "string", description: "Source path" },
          destination: { type: "string", description: "Destination path" },
          workspace_root: { type: "string", description: "Workspace root directory (optional)" },
        },
        required: ["source", "destination"],
      },
    },
  • Helper function resolveWorkspacePath used by the move_path handler. If the path starts with '/' (Unix absolute) or a drive letter (Windows absolute), it returns it as-is. Otherwise it joins the workspace_root (or cwd) with the relative path and resolves it to an absolute path.
    function resolveWorkspacePath(filePath: string, workspaceRoot?: string): string {
      if (filePath.startsWith("/") || /^[A-Za-z]:/.test(filePath)) return filePath;
      const base = workspaceRoot ?? process.cwd();
      return resolve(join(base, filePath));
    }
  • src/index.ts:426-426 (registration)
    Registration of all tools via ListToolsRequestSchema handler. The TOOLS array (which includes 'move_path') is returned when the client requests the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
Behavior2/5

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

The description only states the basic action without disclosing behavioral traits. It fails to mention whether the operation overwrites existing destinations, what happens on partial failure, atomicity, or permission requirements. Since no annotations exist, the description carries the full burden but provides almost no behavioral context.

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

Conciseness3/5

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

The description is extremely concise (one sentence) and front-loaded, but it sacrifices necessary detail. While there is no fluff, the brevity reduces its value. It could have included key behavioral notes without becoming verbose.

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 complexity of a move/rename operation (including potential overwrite, cross-workspace moves, and error handling), the description is incomplete. No output schema is provided, and annotations are absent, so the description should compensate but fails to address conflict resolution or operation boundaries.

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?

The input schema has 100% description coverage, with each parameter having a brief description (e.g., 'Source path'). The tool description adds no additional meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.

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 explicitly states 'Move or rename a file or directory', which clearly identifies the action and resource type. It distinguishes the tool from siblings like create_directory, delete_path, and edit_file, as no other sibling handles move/rename.

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?

No guidance is provided on when to use this tool vs alternatives. There is no mention of prerequisites, restrictions, or situations where another tool (e.g., copy then delete, or using write_file) might be more appropriate.

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/KloutDevs/vscode-mcp'

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