move_file
Move or rename files on Windows systems by specifying source and destination paths to organize or relocate files.
Instructions
移动或重命名文件
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | 源文件路径 | |
| destination | Yes | 目标文件路径 |
Implementation Reference
- src/tools/filesystem.js:202-209 (handler)The core handler function that executes the move_file tool logic using Node.js fs.rename to move or rename the file from source to destination, returning success status and message or error.async moveFile(source, destination) { try { await fs.rename(source, destination); return { success: true, source, destination, message: '移动成功' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/filesystem.js:82-93 (schema)Tool definition including name, description, and input schema specifying required 'source' and 'destination' string parameters for validation.{ name: 'move_file', description: '移动或重命名文件', inputSchema: { type: 'object', properties: { source: { type: 'string', description: '源文件路径' }, destination: { type: 'string', description: '目标文件路径' }, }, required: ['source', 'destination'], }, },
- src/tools/filesystem.js:129-130 (registration)Registers and dispatches the 'move_file' tool call to the moveFile handler method within the executeTool switch statement.case 'move_file': return await this.moveFile(args.source, args.destination);
- src/tools/filesystem.js:110-112 (registration)Registers 'move_file' in the canHandle method's tool list for routing tool calls to this module.const tools = ['read_file', 'write_file', 'list_directory', 'create_directory', 'delete_file', 'copy_file', 'move_file', 'search_files']; return tools.includes(toolName);