Skip to main content
Glama

download_file

Download files from MinIO storage buckets to a specified local path by providing bucket name, object name, and file path. Integrates with MinIO Storage MCP for efficient object storage management.

Instructions

从存储桶下载文件

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
filePathYes本地保存路径
objectNameYes对象名称

Implementation Reference

  • Core handler function that ensures connection, creates directory if needed, and downloads the file from MinIO bucket to local path using fGetObject.
    async downloadFile(bucketName: string, objectName: string, filePath: string): Promise<void> { this.ensureConnected(); const dir = path.dirname(filePath); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } await this.client!.fGetObject(bucketName, objectName, filePath); }
  • MCP server tool handler that validates input arguments and delegates to MinIOStorageClient.downloadFile, returning success message.
    case 'download_file': { const { bucketName, objectName, filePath } = z.object({ bucketName: z.string(), objectName: z.string(), filePath: z.string() }).parse(args); await this.minioClient.downloadFile(bucketName, objectName, filePath); return { content: [ { type: 'text', text: `成功下载文件 ${bucketName}/${objectName} 到 ${filePath}` } ] }; }
  • Tool schema definition including name, description, and input schema registered in list_tools handler.
    { name: 'download_file', description: '从存储桶下载文件', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, objectName: { type: 'string', description: '对象名称' }, filePath: { type: 'string', description: '本地保存路径' } }, required: ['bucketName', 'objectName', 'filePath'] } },

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