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),
    }));
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action ('列出' - list) without detailing traits like whether it's read-only (implied but not stated), pagination behavior, rate limits, error conditions, or what the output format looks like. This leaves significant gaps for a tool that likely interacts with storage.

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, efficient sentence ('列出COS中的对象') that directly states the purpose without waste. However, it's overly concise to the point of under-specification, as it lacks necessary context about COS and behavioral details, slightly reducing its effectiveness despite the clean structure.

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 tool's complexity (interacting with object storage), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values, error handling, or important behavioral aspects like whether it lists recursively or includes metadata. For a tool with one parameter but significant implicit context, this is inadequate.

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?

The schema description coverage is 100%, with the single parameter 'prefix' fully documented in the schema ('对象键的过滤前缀,默认列出所有对象' - filter prefix for object keys, defaults to listing all objects). The description adds no additional meaning beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without extra param info.

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 '列出COS中的对象' (List objects in COS) states a clear verb ('列出' - list) and resource ('对象' - objects), but lacks specificity about what COS is (likely Cloud Object Storage) and doesn't differentiate from sibling tools like 'get_signed_url' which also deals with objects. It's vague about scope beyond basic listing.

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 that this is for listing objects (vs. deleting with 'delete_object' or uploading with 'upload_file'), nor does it specify prerequisites like authentication or context for filtering with the prefix parameter. Usage is implied but not explicit.

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

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