assessQuality
Evaluate image quality using the specified object path in Tencent Cloud COS. Simplifies image processing by providing assessments directly through the MCP server without additional coding.
Instructions
图片处理-图片质量评估
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"objectKey": "<objectKey>"
},
"name": "assessQuality"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objectKey | Yes | 图片在存储桶里的路径 |
Implementation Reference
- src/services/ci/ai.service.ts:64-88 (handler)The core handler function in CIAIService that assesses image quality by making a GET request to COS with ci-process='AssessQuality' query parameter.
async assessQuality(objectKey: string) { try { const result = await this.cos.request({ Bucket: this.bucket, Region: this.region, Method: 'GET', Key: objectKey, Query: { 'ci-process': 'AssessQuality', }, }); return { isSuccess: true, message: '图片处理成功', data: result, }; } catch (error) { return { isSuccess: false, message: '图片处理失败', data: error, }; } } - src/server.ts:339-357 (registration)MCP tool registration for 'assessQuality', including input schema (objectKey: string) and thin wrapper handler that calls the service method and formats the response.
server.tool( 'assessQuality', '图片处理-图片质量评估', { objectKey: z.string().describe('图片在存储桶里的路径'), }, async ({ objectKey }) => { const res = await CIAIInstance.assessQuality(objectKey); return { content: [ { type: 'text', text: JSON.stringify(res.data, null, 2), }, ], isError: !res.isSuccess, }; }, ); - src/server.ts:343-344 (schema)Zod schema defining the input parameter for the assessQuality tool.
objectKey: z.string().describe('图片在存储桶里的路径'), },