imageInfo
Extract metadata and details from images stored in Tencent Cloud Object Storage (COS) using the specified file path for efficient image management and processing.
Instructions
图片处理-获取图片信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objectKey | Yes | 图片在存储桶里的路径 |
Implementation Reference
- src/services/ci/pic.service.ts:22-44 (handler)Core handler function that executes the imageInfo tool logic using the COS SDK to fetch image information.async imageInfo(objectKey: string) { try { const result = await this.cos.request({ Bucket: this.bucket, Region: this.region, Method: 'GET', Key: objectKey, Action: 'imageInfo', RawBody: false, }); return { isSuccess: true, message: '获取图片信息成功', data: result, }; } catch (error) { return { isSuccess: false, message: '获取图片信息失败', data: error, }; } }
- src/server.ts:319-337 (registration)MCP server tool registration for 'imageInfo', including input schema (objectKey: z.string()) and wrapper that calls the service handler.server.tool( 'imageInfo', '图片处理-获取图片信息', { objectKey: z.string().describe('图片在存储桶里的路径'), }, async ({ objectKey }) => { const res = await CIPicInstance.imageInfo(objectKey); return { content: [ { type: 'text', text: JSON.stringify(res.data, null, 2), }, ], isError: !res.isSuccess, }; }, );