Skip to main content
Glama

delete_objects

Remove multiple objects from a specified bucket in MinIO Storage MCP, streamlining batch deletions for efficient storage management.

Instructions

批量删除存储桶中的对象

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
objectNamesYes对象名称列表

Implementation Reference

  • Core implementation of the delete_objects tool: batch deletes objects from MinIO bucket using removeObjects, handles errors, returns BatchOperationResult.
    async deleteObjects(bucketName: string, objectNames: string[]): Promise<BatchOperationResult> { this.ensureConnected(); const result: BatchOperationResult = { success: true, successCount: 0, failureCount: 0, errors: [] }; try { await this.client!.removeObjects(bucketName, objectNames); result.successCount = objectNames.length; } catch (error) { result.success = false; result.failureCount = objectNames.length; result.errors.push({ item: objectNames.join(', '), error: error instanceof Error ? error.message : String(error) }); } return result; }
  • src/index.ts:174-185 (registration)
    Registration of the delete_objects tool in the ListTools response, including name, description, and input schema.
    { name: 'delete_objects', description: '批量删除存储桶中的对象', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, objectNames: { type: 'array', items: { type: 'string' }, description: '对象名称列表' } }, required: ['bucketName', 'objectNames'] } },
  • Type definition for the output of deleteObjects operation (BatchOperationResult).
    export interface BatchOperationResult { success: boolean; successCount: number; failureCount: number; errors: Array<{ item: string; error: string; }>; }
  • MCP server dispatch handler for delete_objects: validates input with zod, calls minioClient.deleteObjects, formats response.
    case 'delete_objects': { const { bucketName, objectNames } = z.object({ bucketName: z.string(), objectNames: z.array(z.string()) }).parse(args); const result = await this.minioClient.deleteObjects(bucketName, objectNames); return { content: [ { type: 'text', text: `批量删除完成: 成功 ${result.successCount} 个, 失败 ${result.failureCount} 个${result.errors.length > 0 ? '\n错误:\n' + result.errors.map(e => `- ${e.item}: ${e.error}`).join('\n') : ''}` } ] }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/minio-storage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server