Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

fs_move_file

Move or rename files and directories by specifying source and destination paths to organize your development workspace.

Instructions

Move or rename a file or directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource path
destinationYesDestination path

Implementation Reference

  • The main handler function for the fs_move_file tool. It performs the file/directory move operation using Node.js fs.rename and returns a standardized ToolResponse.
    export async function moveFile(args: z.infer<typeof moveFileSchema>): Promise<ToolResponse> { try { await fs.rename(args.source, args.destination); return { content: [ { type: "text" as const, text: JSON.stringify({ success: true, source: args.source, destination: args.destination, message: 'File/directory moved successfully' }, null, 2) } ] }; } catch (error) { return { content: [ { type: "text" as const, text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error) }, null, 2) } ], isError: true }; } }
  • Zod schema used for input validation in the fs_move_file handler.
    export const moveFileSchema = z.object({ source: z.string().describe('Source path'), destination: z.string().describe('Destination path') });
  • MCP tool metadata definition for fs_move_file, including the input schema exposed to the model.
    { name: 'fs_move_file', description: 'Move or rename a file or directory', inputSchema: { type: 'object', properties: { source: { type: 'string', description: 'Source path' }, destination: { type: 'string', description: 'Destination path' } }, required: ['source', 'destination'] } },
  • src/index.ts:337-339 (registration)
    Registration and dispatch logic in the main MCP server handler that routes 'fs_move_file' calls to the appropriate schema validation and handler execution.
    if (name === 'fs_move_file') { const validated = moveFileSchema.parse(args); return await moveFile(validated);

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/ConnorBoetig-dev/mcp2'

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