Skip to main content
Glama

download_file

Download files from MinIO storage buckets to local systems by specifying bucket name, object name, and save path for data retrieval and storage management.

Instructions

从存储桶下载文件

Input Schema

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

Implementation Reference

  • Core handler function that performs the file download 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); }
  • src/index.ts:149-161 (registration)
    Tool registration in ListToolsRequestHandler, defining name, description, and input schema.
    { name: 'download_file', description: '从存储桶下载文件', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, objectName: { type: 'string', description: '对象名称' }, filePath: { type: 'string', description: '本地保存路径' } }, required: ['bucketName', 'objectName', 'filePath'] } },
  • Zod schema validation for download_file tool arguments in the CallTool handler.
    const { bucketName, objectName, filePath } = z.object({ bucketName: z.string(), objectName: z.string(), filePath: z.string() }).parse(args);
  • Dispatch handler in CallToolRequestHandler that invokes the MinIO client's downloadFile method and formats response.
    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}` } ] }; }

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