Skip to main content
Glama
pickstar-2002

MinIO Storage MCP

get_storage_stats

Retrieve storage usage statistics and metrics from MinIO object storage to monitor capacity and analyze data distribution.

Instructions

获取存储统计信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:226-229 (registration)
    Registration of the 'get_storage_stats' tool in the ListTools response, including name, description, and empty input schema.
    {
      name: 'get_storage_stats',
      description: '获取存储统计信息',
      inputSchema: { type: 'object', properties: {} }
  • MCP CallTool handler case for 'get_storage_stats': calls minioClient.getStorageStats() and returns formatted text response.
    case 'get_storage_stats': {
      const stats = await this.minioClient.getStorageStats();
      return {
        content: [
          {
            type: 'text',
            text: `存储统计信息:\n- 总存储桶数: ${stats.totalBuckets}\n- 总对象数: ${stats.totalObjects}\n- 总大小: ${(stats.totalSize / 1024 / 1024).toFixed(2)} MB\n\n各存储桶详情:\n${stats.bucketStats.map(b => `- ${b.bucketName}: ${b.objectCount} 个对象, ${(b.totalSize / 1024 / 1024).toFixed(2)} MB`).join('\n')}`
          }
        ]
      };
    }
  • Core implementation of getStorageStats(): lists all buckets and objects recursively, computes total stats and per-bucket stats.
    async getStorageStats(): Promise<StorageStats> {
      this.ensureConnected();
      
      const buckets = await this.listBuckets();
      const bucketStats = [];
      let totalObjects = 0;
      let totalSize = 0;
    
      for (const bucket of buckets) {
        const objects = await this.listObjects(bucket.name, undefined, true);
        const bucketSize = objects.reduce((sum, obj) => sum + obj.size, 0);
        const objectCount = objects.length;
        
        bucketStats.push({
          bucketName: bucket.name,
          objectCount,
          totalSize: bucketSize
        });
        
        totalObjects += objectCount;
        totalSize += bucketSize;
      }
    
      return {
        totalBuckets: buckets.length,
        totalObjects,
        totalSize,
        bucketStats
      };
    }
  • TypeScript interface defining the StorageStats return type used by getStorageStats().
    export interface StorageStats {
      totalBuckets: number;
      totalObjects: number;
      totalSize: number;
      bucketStats: Array<{
        bucketName: string;
        objectCount: number;
        totalSize: number;
      }>;
    }

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