Skip to main content
Glama
ai-yliu

Filesystem MCP Server

by ai-yliu

move_file

Move or rename files and directories by specifying source and destination paths to reorganize your filesystem structure.

Instructions

Move or rename files and directories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource path
destinationYesDestination path

Implementation Reference

  • Handler for the move_file tool: extracts source and destination paths, validates them, checks if destination exists (throws if yes), ensures parent directory exists, moves the file using fs.move, and returns success message.
    case 'move_file': { const { source, destination } = request.params.arguments as { source: string; destination: string }; validatePath(source); validatePath(destination); // Check if destination exists const destinationExists = await fs.pathExists(destination); if (destinationExists) { throw new McpError( ErrorCode.InvalidRequest, `Destination already exists: ${destination}` ); } // Ensure parent directory of destination exists await fs.ensureDir(path.dirname(destination)); await fs.move(source, destination); return { content: [ { type: 'text', text: `Successfully moved ${source} to ${destination}`, }, ], }; }
  • Schema definition for the move_file tool, including name, description, and inputSchema specifying source and destination paths as required strings.
    { name: 'move_file', description: 'Move or rename files and directories', inputSchema: { type: 'object', properties: { source: { type: 'string', description: 'Source path', }, destination: { type: 'string', description: 'Destination path', }, }, required: ['source', 'destination'], },

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/ai-yliu/filesystem-mcp-server'

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