Skip to main content
Glama
Tencent

Tencent Cloud COS MCP Server

Official
by Tencent

getBucket

Retrieve a list of files from a specified bucket in Tencent Cloud COS using the MCP protocol, enabling direct access and management of stored data without coding.

Instructions

查询存储桶内的文件列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
PrefixNo文件列表的路径前缀,默认根路径

Implementation Reference

  • MCP tool registration and handler for 'getBucket'. Defines input schema for Prefix parameter, executes by calling CosService.getBucket(Prefix), and returns JSON-formatted result with error flag.
    server.tool(
      'getBucket',
      '查询存储桶内的文件列表',
      {
        Prefix: z.string().optional().describe('文件列表的路径前缀,默认根路径'),
      },
      async ({ Prefix = '' }) => {
        const res = await COSInstance.getBucket(Prefix);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(res.data, null, 2),
            },
          ],
          isError: !res.isSuccess,
        };
      },
    );
  • Input schema for getBucket tool using Zod: optional Prefix string.
    {
      Prefix: z.string().optional().describe('文件列表的路径前缀,默认根路径'),
    },
  • Helper method in CosService that performs the actual COS getBucket API call with bucket/region/Prefix/Delimiter, handles try-catch, returns structured response.
    async getBucket(Prefix = '') {
      try {
        const result = await this.cos.getBucket({
          Bucket: this.bucket,
          Region: this.region,
          Prefix,
          Delimiter: '',
        });
        return {
          isSuccess: true,
          message: '获取列表成功',
          data: result,
        };
      } catch (error) {
        return {
          isSuccess: false,
          message: '获取列表失败',
          data: error,
        };
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While '查询' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what happens with large buckets. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 Chinese sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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

Completeness3/5

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

For a simple list operation with one documented parameter and no output schema, the description is minimally adequate. However, with no annotations and siblings that overlap in functionality, it should provide more context about when this specific list operation is needed versus other bucket access tools.

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%, so the schema already documents the single 'Prefix' parameter completely. The description doesn't add any parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter semantics.

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 verb '查询' (query) and resource '存储桶内的文件列表' (file list in storage bucket), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getObject' or 'getObjectUrl' which also retrieve bucket-related information, preventing a perfect score.

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. With siblings like 'getObject' (retrieve specific file) and 'getObjectUrl' (get file URL), there's no indication of when this list operation is preferred over those individual file operations.

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

Related 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/Tencent/cos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server