copy_file
Copy files between locations on Windows systems using source and destination paths for file management and organization.
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:193-200 (handler)The `copyFile` method implements the core logic for the `copy_file` tool, using Node.js `fs.copyFile` to copy from source to destination, with success/error response.async copyFile(source, destination) { try { await fs.copyFile(source, destination); return { success: true, source, destination, message: '复制成功' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/filesystem.js:70-81 (schema)The tool definition including name, description, and input schema for `copy_file` in `getToolDefinitions()`.{ name: 'copy_file', description: '复制文件', inputSchema: { type: 'object', properties: { source: { type: 'string', description: '源文件路径' }, destination: { type: 'string', description: '目标文件路径' }, }, required: ['source', 'destination'], }, },
- src/tools/filesystem.js:127-128 (registration)Registration and dispatch logic in `executeTool` switch statement that routes `copy_file` calls to the handler.case 'copy_file': return await this.copyFile(args.source, args.destination);