Skip to main content
Glama
Tencent

Tencent Cloud COS MCP Server

Official
by Tencent

getObjectUrl

Generate a signed download URL for files stored in a bucket using the Tencent Cloud COS MCP Server, enabling secure access without manual coding.

Instructions

获取存储桶内的文件的带签名的下载链接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectKeyYes文件的路径

Implementation Reference

  • src/server.ts:251-269 (registration)
    Registers the MCP tool 'getObjectUrl' with description, Zod input schema for objectKey, and handler that delegates to CosService.getObjectUrl and returns formatted response.
    server.tool(
      'getObjectUrl',
      '获取存储桶内的文件的带签名的下载链接',
      {
        objectKey: z.string().describe('文件的路径'),
      },
      async ({ objectKey = '/' }) => {
        const res = await COSInstance.getObjectUrl(objectKey);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(res.data, null, 2),
              },
            ],
            isError: !res.isSuccess,
          };
      },
    );
  • The core handler logic in CosService that generates a signed download URL for the specified objectKey using the COS SDK.
    async getObjectUrl(ObjectKey: string) {
      try {
        const result = await new Promise((resolve, reject) => {
          this.cos.getObjectUrl(
            {
              Bucket: this.bucket,
              Region: this.region,
              Key: ObjectKey,
            },
            (error, data) => (error ? reject(error) : resolve(data)),
          );
        });
    
        return {
          isSuccess: true,
          message: '获取带签名 ObjectUrl 成功',
          data: result,
        };
      } catch (error) {
        return {
          isSuccess: false,
          message: '获取带签名 ObjectUrl 失败',
          data: error,
        };
      }
    }
  • Zod input schema defining the objectKey parameter for the getObjectUrl tool.
    {
      objectKey: z.string().describe('文件的路径'),
    },
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. While it mentions '带签名的' (signed), implying authentication or security aspects, it doesn't elaborate on what this entails (e.g., expiration time, permissions required, or rate limits). For a tool that likely involves sensitive operations (generating signed URLs), this lack of detail 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 that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every part of the sentence contributes essential information, earning its place.

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 (generating signed URLs for file access) and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, URL expiration, or error conditions, nor does it explain the return value (e.g., the structure of the signed URL). For a tool with no structured safety or output information, this leaves critical gaps in understanding.

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 parameter 'objectKey' clearly documented as '文件的路径' (file path). The description adds no additional meaning beyond this, as it doesn't explain path formats, constraints, or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema adequately handles parameter semantics without extra value from the description.

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 ('获取带签名的下载链接' - get signed download URL) and the resource ('存储桶内的文件' - file in storage bucket), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'getObject' which might retrieve the file itself rather than just a URL, so it misses full sibling differentiation.

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. There's no mention of prerequisites (e.g., needing authentication or bucket access), comparison to sibling tools like 'getObject' (which might fetch the actual file), or scenarios where a signed URL is preferred over direct access. This leaves the agent with insufficient context for appropriate tool selection.

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