copy_object
Copy objects between buckets in MinIO storage. Specify source and destination buckets with object names to duplicate files.
Instructions
复制对象
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceBucket | Yes | 源存储桶名称 | |
| sourceObject | Yes | 源对象名称 | |
| destBucket | Yes | 目标存储桶名称 | |
| destObject | Yes | 目标对象名称 |
Implementation Reference
- src/minio-client.ts:188-193 (handler)The primary handler function that executes the object copy operation using the MinIO client's copyObject method.async copyObject(sourceBucket: string, sourceObject: string, destBucket: string, destObject: string): Promise<void> { this.ensureConnected(); const copyConditions = new Minio.CopyConditions(); await this.client!.copyObject(destBucket, destObject, `/${sourceBucket}/${sourceObject}`, copyConditions); }
- src/index.ts:486-503 (handler)Tool dispatcher in the CallToolRequest handler that validates input with Zod and calls the MinIO client handler.case 'copy_object': { const { sourceBucket, sourceObject, destBucket, destObject } = z.object({ sourceBucket: z.string(), sourceObject: z.string(), destBucket: z.string(), destObject: z.string() }).parse(args); await this.minioClient.copyObject(sourceBucket, sourceObject, destBucket, destObject); return { content: [ { type: 'text', text: `成功复制对象从 ${sourceBucket}/${sourceObject} 到 ${destBucket}/${destObject}` } ] }; }
- src/index.ts:186-199 (registration)Registration of the copy_object tool in the ListToolsRequestSchema response, defining name, description, and input schema.{ name: 'copy_object', description: '复制对象', inputSchema: { type: 'object', properties: { sourceBucket: { type: 'string', description: '源存储桶名称' }, sourceObject: { type: 'string', description: '源对象名称' }, destBucket: { type: 'string', description: '目标存储桶名称' }, destObject: { type: 'string', description: '目标对象名称' } }, required: ['sourceBucket', 'sourceObject', 'destBucket', 'destObject'] } },
- src/index.ts:487-492 (schema)Zod input validation schema used in the copy_object tool handler.const { sourceBucket, sourceObject, destBucket, destObject } = z.object({ sourceBucket: z.string(), sourceObject: z.string(), destBucket: z.string(), destObject: z.string() }).parse(args);