Skip to main content
Glama
pickstar-2002

MinIO Storage MCP

download_files

Download multiple files from MinIO storage buckets to specified local paths for batch file retrieval and storage management.

Instructions

批量下载文件

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
filesYes文件列表

Implementation Reference

  • Main handler for the 'download_files' MCP tool. Validates input parameters using Zod, invokes the MinIO client's downloadFiles method, and returns a formatted text response with batch operation results.
    case 'download_files': {
      const { bucketName, files } = z.object({
        bucketName: z.string(),
        files: z.array(z.object({
          objectName: z.string(),
          localPath: z.string()
        }))
      }).parse(args);
      
      const result = await this.minioClient.downloadFiles(bucketName, files);
      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') : ''}`
          }
        ]
      };
    }
  • src/index.ts:255-277 (registration)
    Registration of the 'download_files' tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    {
      name: 'download_files',
      description: '批量下载文件',
      inputSchema: {
        type: 'object',
        properties: {
          bucketName: { type: 'string', description: '存储桶名称' },
          files: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                objectName: { type: 'string', description: '对象名称' },
                localPath: { type: 'string', description: '本地保存路径' }
              },
              required: ['objectName', 'localPath']
            },
            description: '文件列表'
          }
        },
        required: ['bucketName', 'files']
      }
    },
  • Core implementation of batch file downloads from MinIO bucket. Iterates over file list, calls individual downloadFile for each, tracks successes and failures using BatchOperationResult.
    async downloadFiles(bucketName: string, files: Array<{ objectName: string; localPath: string }>): Promise<BatchOperationResult> {
      this.ensureConnected();
      
      const result: BatchOperationResult = {
        success: true,
        successCount: 0,
        failureCount: 0,
        errors: []
      };
    
      for (const file of files) {
        try {
          await this.downloadFile(bucketName, file.objectName, file.localPath);
          result.successCount++;
        } catch (error) {
          result.success = false;
          result.failureCount++;
          result.errors.push({
            item: file.objectName,
            error: error instanceof Error ? error.message : String(error)
          });
        }
      }
    
      return result;
    }
  • Type definition for BatchOperationResult used in download_files response.
    export interface BatchOperationResult {
      success: boolean;
      successCount: number;
      failureCount: number;
      errors: Array<{
        item: string;
        error: string;
      }>;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('download') but doesn't describe side effects (e.g., whether it overwrites local files, requires authentication, or has rate limits), output format, or error handling. For a batch operation with potential local system impact, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase ('批量下载文件'), which is concise and front-loaded. However, it's overly terse, lacking necessary details for a batch download tool. While efficient, it under-specifies, slightly reducing its effectiveness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a batch download tool with no annotations and no output schema, the description is incomplete. It doesn't address critical aspects like what the tool returns (e.g., success/failure status), error conditions, or dependencies on other tools (e.g., 'connect_minio'). For a tool that interacts with storage and local systems, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'bucketName' and 'files' (including nested 'objectName' and 'localPath'). The description adds no additional meaning beyond the schema, such as explaining parameter relationships or constraints. Baseline 3 is appropriate since the schema adequately documents parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '批量下载文件' (batch download files) states the basic action but is vague about scope and resources. It doesn't specify from where files are downloaded (e.g., from a storage bucket) or distinguish it from sibling 'download_file' (singular). The description lacks specificity about the target system or context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a connected MinIO instance), compare it to 'download_file' for single files, or specify use cases like batch processing. Without such context, an agent must infer usage from the tool name and schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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