Skip to main content
Glama
pickstar-2002

MinIO Storage MCP

upload_file

Upload files to MinIO storage buckets with specified metadata. This tool transfers local files to cloud storage for organized data management and accessibility.

Instructions

上传文件到存储桶

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
objectNameYes对象名称
filePathYes本地文件路径
metadataNo文件元数据(可选)

Implementation Reference

  • MCP CallTool handler case for 'upload_file': validates arguments with Zod schema matching the tool inputSchema, calls minioClient.uploadFile, and returns success message.
    case 'upload_file': {
      const { bucketName, objectName, filePath, metadata } = z.object({
        bucketName: z.string(),
        objectName: z.string(),
        filePath: z.string(),
        metadata: z.record(z.string()).optional()
      }).parse(args);
      
      await this.minioClient.uploadFile(bucketName, objectName, filePath, metadata);
      return {
        content: [
          {
            type: 'text',
            text: `成功上传文件 ${filePath} 到 ${bucketName}/${objectName}`
          }
        ]
      };
    }
  • Tool schema definition in ListTools response, specifying name, description, and inputSchema for 'upload_file'.
      name: 'upload_file',
      description: '上传文件到存储桶',
      inputSchema: {
        type: 'object',
        properties: {
          bucketName: { type: 'string', description: '存储桶名称' },
          objectName: { type: 'string', description: '对象名称' },
          filePath: { type: 'string', description: '本地文件路径' },
          metadata: { type: 'object', description: '文件元数据(可选)' }
        },
        required: ['bucketName', 'objectName', 'filePath']
      }
    },
  • Core implementation of file upload using MinIO client's putObject method, called by the MCP handler.
    async uploadFile(bucketName: string, objectName: string, filePath: string, metadata?: Record<string, string>): Promise<void> {
      this.ensureConnected();
      
      if (!fs.existsSync(filePath)) {
        throw new Error(`文件不存在: ${filePath}`);
      }
    
      const stats = fs.statSync(filePath);
      const stream = fs.createReadStream(filePath);
      
      await this.client!.putObject(bucketName, objectName, stream, stats.size, metadata);
    }
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 ('upload') but lacks details on permissions required, whether the operation is idempotent, error handling (e.g., if the bucket doesn't exist), or response format. For a mutation tool with zero annotation coverage, 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.

Conciseness5/5

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

The description is a single, efficient sentence in Chinese that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a basic upload operation, with zero waste or redundancy.

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 file upload operation (mutation, multiple parameters, no output schema), the description is incomplete. It lacks information on behavioral traits (e.g., overwrite behavior, error cases), usage context, and output expectations. With no annotations and no output schema, the description should provide more guidance to be fully helpful.

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 all parameters documented in the schema itself (e.g., 'bucketName' as storage bucket name, 'filePath' as local file path). The description doesn't add any meaning beyond what the schema provides, such as explaining parameter interactions or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose4/5

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

The description '上传文件到存储桶' clearly states the action (upload) and target (file to storage bucket) in Chinese, which translates to 'Upload file to storage bucket'. It specifies the verb and resource, making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'upload_files' (plural), leaving some ambiguity about when to use one versus the other.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing bucket), exclusions, or compare it to siblings like 'upload_files' or 'generate_presigned_url'. Without such context, users must infer usage from the tool name and parameters 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