get_object_info
Retrieve metadata and details for specific objects in MinIO storage buckets to inspect file properties and storage information.
Instructions
获取对象信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 | |
| objectName | Yes | 对象名称 |
Implementation Reference
- src/minio-client.ts:198-210 (handler)Core implementation of the getObjectInfo tool handler using MinIO client's statObject method to fetch and return object metadata.async getObjectInfo(bucketName: string, objectName: string): Promise<ObjectInfo> { this.ensureConnected(); const stat = await this.client!.statObject(bucketName, objectName); return { name: objectName, size: stat.size, lastModified: stat.lastModified, etag: stat.etag, contentType: stat.metaData['content-type'], isDir: false }; }
- src/index.ts:505-519 (handler)MCP CallTool handler case for 'get_object_info' that validates input, invokes the minioClient handler, and formats response.case 'get_object_info': { const { bucketName, objectName } = z.object({ bucketName: z.string(), objectName: z.string() }).parse(args); const info = await this.minioClient.getObjectInfo(bucketName, objectName); return { content: [ { type: 'text', text: `对象信息:\n- 名称: ${info.name}\n- 大小: ${info.size} 字节\n- 最后修改: ${info.lastModified.toISOString()}\n- ETag: ${info.etag}\n- 内容类型: ${info.contentType || '未知'}` } ] };
- src/index.ts:200-210 (registration)Tool registration entry in ListTools response defining name, description, and input schema for get_object_info.{ name: 'get_object_info', description: '获取对象信息', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, objectName: { type: 'string', description: '对象名称' } }, required: ['bucketName', 'objectName'] }
- src/index.ts:203-210 (schema)Input schema definition for the get_object_info tool.inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, objectName: { type: 'string', description: '对象名称' } }, required: ['bucketName', 'objectName'] }