update_object
Overwrite existing objects in S3-compatible storage buckets by specifying bucket name, object key, and new content to update stored data.
Instructions
Update (overwrite) an object in a bucket
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | New object content | |
| bucket | Yes | Bucket name | |
| key | Yes | Object key |
Implementation Reference
- src/server.ts:188-193 (handler)The handler function for the 'update_object' MCP tool. It calls the S3Client's updateObject method with the provided bucket, key, and body, then returns a success response.async ({ bucket, key, body }) => { await this.s3Client.updateObject(bucket, key, body); return { content: [{ type: "text", text: JSON.stringify({ success: true }) }], }; }
- src/server.ts:183-187 (schema)Input schema validation for the 'update_object' tool using Zod, defining bucket, key, and body parameters.{ bucket: z.string().describe("Bucket name"), key: z.string().describe("Object key"), body: z.string().describe("New object content"), },
- src/server.ts:180-194 (registration)Registration of the 'update_object' tool on the MCP server, including name, description, input schema, and handler.this.server.tool( "update_object", "Update (overwrite) an object in a bucket", { bucket: z.string().describe("Bucket name"), key: z.string().describe("Object key"), body: z.string().describe("New object content"), }, async ({ bucket, key, body }) => { await this.s3Client.updateObject(bucket, key, body); return { content: [{ type: "text", text: JSON.stringify({ success: true }) }], }; } );
- src/s3Client.ts:127-130 (helper)Supporting helper method in S3Client class that implements object update by delegating to putObject (which overwrites existing objects).async updateObject(bucket: string, key: string, body: string) { // S3 putObject overwrites by default return this.putObject(bucket, key, body); }