move_file
Move or rename files on Windows systems by specifying source and destination paths to organize files or change their names.
Instructions
移动或重命名文件
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | 源文件路径 | |
| destination | Yes | 目标文件路径 |
Input Schema (JSON Schema)
{
"properties": {
"destination": {
"description": "目标文件路径",
"type": "string"
},
"source": {
"description": "源文件路径",
"type": "string"
}
},
"required": [
"source",
"destination"
],
"type": "object"
}
Implementation Reference
- src/tools/filesystem.js:202-209 (handler)The handler function that executes the move_file tool logic by renaming the source file to the destination using fs.rename.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:85-92 (schema)Input schema definition for the move_file tool, specifying source and destination as required string properties.inputSchema: { type: 'object', properties: { source: { type: 'string', description: '源文件路径' }, destination: { type: 'string', description: '目标文件路径' }, }, required: ['source', 'destination'], },
- src/tools/filesystem.js:82-93 (registration)Registers the move_file tool in getToolDefinitions() with its name, description, and input schema.{ 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 the handler for move_file in the executeTool switch statement.case 'move_file': return await this.moveFile(args.source, args.destination);
- src/tools/filesystem.js:111-111 (registration)Includes move_file in the list of handleable tools in canHandle method.'delete_file', 'copy_file', 'move_file', 'search_files'];