copy_object
Copy an object from one S3-compatible storage bucket to another bucket or location within Akave's storage system.
Instructions
Copy an object to another bucket/key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destinationBucket | Yes | Destination bucket name | |
| destinationKey | Yes | Destination object key | |
| sourceBucket | Yes | Source bucket name | |
| sourceKey | Yes | Source object key |
Implementation Reference
- src/server.ts:235-250 (handler)MCP tool handler function for 'copy_object' that calls s3Client.copyObject and returns success responseasync ({ sourceBucket, sourceKey, destinationBucket, destinationKey, }) => { await this.s3Client.copyObject( sourceBucket, sourceKey, destinationBucket, destinationKey ); return { content: [{ type: "text", text: JSON.stringify({ success: true }) }], }; }
- src/server.ts:229-234 (schema)Input schema using Zod for copy_object tool parameters{ sourceBucket: z.string().describe("Source bucket name"), sourceKey: z.string().describe("Source object key"), destinationBucket: z.string().describe("Destination bucket name"), destinationKey: z.string().describe("Destination object key"), },
- src/server.ts:226-251 (registration)Registration of the 'copy_object' MCP tool including name, description, schema, and handlerthis.server.tool( "copy_object", "Copy an object to another bucket/key", { sourceBucket: z.string().describe("Source bucket name"), sourceKey: z.string().describe("Source object key"), destinationBucket: z.string().describe("Destination bucket name"), destinationKey: z.string().describe("Destination object key"), }, async ({ sourceBucket, sourceKey, destinationBucket, destinationKey, }) => { await this.s3Client.copyObject( sourceBucket, sourceKey, destinationBucket, destinationKey ); return { content: [{ type: "text", text: JSON.stringify({ success: true }) }], }; } );
- src/s3Client.ts:148-160 (helper)S3Client helper method implementing the copy object logic using AWS SDK CopyObjectCommandasync copyObject( sourceBucket: string, sourceKey: string, destinationBucket: string, destinationKey: string ) { const command = new CopyObjectCommand({ Bucket: destinationBucket, Key: destinationKey, CopySource: `/${sourceBucket}/${sourceKey}`, }); return await this.client.send(command); }