Skip to main content
Glama
Tencent

Tencent Cloud COS MCP Server

Official
by Tencent

imageSearchPic

Retrieve visually similar images from a dataset based on an input image. Operates on the Tencent Cloud COS MCP Server, enabling direct access to object storage and image processing without coding.

Instructions

根据输入的图片,从数据集中检索出与输入的图片内容相似的图片

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYes图片地址

Implementation Reference

  • The core handler function implementing the imageSearchPic tool logic, validating input and making a POST request to Tencent Cloud COS for image search using picture URI.
    async imageSearchPic(params: ImageSearchPicParams) {
      // 验证并解析参数
      const validParams = ImageSearchPicParamsSchema.parse(params);
      const { uri } = validParams;
    
      try {
        const key = 'datasetquery/imagesearch'; // 固定值
        const appid = this.bucket.split('-').pop();
        const host = `${appid}.ci.${this.region}.myqcloud.com`;
        const url = `https://${host}/${key}`;
        const body = JSON.stringify({
          DatasetName: this.datasetName,
          Mode: 'pic',
          URI: uri,
        });
    
        const result = await this.cos.request({
          Method: 'POST', // 固定值,必须
          Key: key, // 必须
          Url: url, // 请求的url,必须
          Body: body, // 请求体参数,必须
          Headers: {
            // 设置请求体为 json,固定值,必须
            'Content-Type': 'application/json',
            // 设置响应体为json,固定值,必须
            Accept: 'application/json',
          },
        });
    
        return {
          success: true,
          message: '图像检索成功',
          // data: result.Body.toString()
          data: result,
        };
      } catch (error) {
        return {
          isSuccess: false,
          message: '图像检索失败',
          data: error,
        };
      }
    }
  • src/server.ts:491-509 (registration)
    MCP server tool registration for 'imageSearchPic', defining input schema and delegating to the service instance handler.
    server.tool(
      'imageSearchPic',
      '根据输入的图片,从数据集中检索出与输入的图片内容相似的图片',
      {
        uri: z.string().describe('图片地址'),
      },
      async ({ uri }) => {
        const res = await CIMateInsightInstance.imageSearchPic({ uri });
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(res.data, null, 2),
            },
          ],
          isError: !res.isSuccess,
        };
      },
    );
  • Zod schema definition for ImageSearchPic parameters (uri: string) and inferred TypeScript type, used for input validation in the handler.
    export const ImageSearchPicParamsSchema = z.object({
      uri: z.string(),
    });
    export type ImageSearchPicParams = z.infer<typeof ImageSearchPicParamsSchema>;
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. It mentions retrieval from a dataset but doesn't disclose behavioral traits such as rate limits, authentication needs, what 'similar' means (e.g., visual similarity, semantic similarity), or response format. For a tool with no 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 function without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to understanding the purpose, making it highly concise and well-structured.

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 (image similarity search), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the dataset contains, how similarity is measured, or what the return values are (e.g., list of images, scores). For a retrieval tool with no structured output, more context is needed to guide the agent effectively.

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% (parameter 'uri' is described as '图片地址' - image address), so the baseline is 3. The description adds no additional meaning beyond the schema, such as format requirements (e.g., supported image types, URI protocols) or constraints (e.g., size limits). It relies entirely on the schema for parameter documentation.

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 tool's purpose: '根据输入的图片,从数据集中检索出与输入的图片内容相似的图片' (Retrieve images similar to the input image from a dataset). It specifies the verb '检索出' (retrieve) and resource '图片' (images), but doesn't differentiate from its sibling 'imageSearchText', which performs text-based image search. This makes it clear but not fully sibling-distinct.

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 like 'imageSearchText' (text-based image search) or other image-related tools (e.g., 'aiPicMatting', 'assessQuality'). It implies usage for image similarity retrieval but lacks explicit when/when-not instructions or prerequisites, leaving the agent to infer context.

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