Skip to main content
Glama
156554395

Tencent Cloud COS MCP Server

by 156554395

list_objects

List objects stored in Tencent Cloud Object Storage (COS) with optional prefix filtering for efficient cloud storage management.

Instructions

列出COS中的对象

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixNo对象键的过滤前缀,默认列出所有对象

Implementation Reference

  • Core implementation of listObjects: lists objects in Tencent COS bucket using SDK's getBucket with optional prefix filter, returns formatted list.
    async listObjects(prefix = '') {
      this._checkConfig();
      
      try {
        const params = {
          Bucket: this.config.Bucket,
          Region: this.config.Region,
          Prefix: prefix,
          MaxKeys: 1000
        };
    
        const response = await this.cos.getBucket(params);
        return {
          success: true,
          files: response.Contents || [],
          prefix,
          total: response.Contents?.length || 0
        };
      } catch (error) {
        throw new Error(`列举文件失败: ${error.message}`);
      }
    }
  • MCP CallToolRequestSchema handler case for list_objects: calls cosService.listObjects and returns JSON-formatted response.
    case 'list_objects':
      const listResult = await cosService.listObjects(args.prefix || '');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({ success: true, data: listResult }, null, 2)
          }
        ]
      };
  • Input schema definition for list_objects tool: object with optional 'prefix' string parameter.
    list_objects: {
      name: 'list_objects',
      description: '列出COS中的对象',
      inputSchema: {
        type: 'object',
        properties: {
          prefix: {
            type: 'string',
            description: '对象键的过滤前缀,默认列出所有对象'
          }
        }
      }
    },
  • index.js:393-395 (registration)
    Registers ListToolsRequestSchema handler returning all tools including list_objects.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools),
    }));

Tool Definition Quality

Score is being calculated. Check back soon.

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/156554395/tx-cos-mcp'

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