Skip to main content
Glama

aiQrcode

Extract text and data from QR code images stored in cloud storage buckets using image processing and recognition capabilities.

Instructions

图片处理-二维码识别-识别存储桶内二维码图片内容

Input Schema

NameRequiredDescriptionDefault
objectKeyYesCOS对象键(完整路径)示例: images/qrcode.jpg

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "objectKey": { "description": "COS对象键(完整路径)示例: images/qrcode.jpg", "type": "string" } }, "required": [ "objectKey" ], "type": "object" }

Implementation Reference

  • Core implementation of the aiQrcode tool handler in the CIAIService class. Performs QR code recognition by sending a GET request to Tencent COS with ci-process: QRcode query parameter.
    async aiQrcode(objectKey: string) { try { const result = await new Promise((resolve, reject) => { this.cos.request( { Bucket: this.bucket, // 存储桶,必须字段 Region: this.region, // 存储桶所在地域,必须字段 如 ap-beijing Method: 'GET', Key: objectKey, // Url: url, Query: { 'ci-process': 'QRcode', // 数据万象处理能力,二维码识别固定为 QRcode, cover: 0, }, }, function (error, data) { if (error) { // 处理请求失败 reject(error); } else { // 处理请求成功 resolve(data); } }, ); }); return { isSuccess: true, message: '二维码识别成功', data: result, }; } catch (error) { return { isSuccess: false, message: '二维码识别失败', data: error, }; } }
  • src/server.ts:401-421 (registration)
    Registration of the 'aiQrcode' MCP tool, including name, description, Zod input schema for objectKey, and wrapper handler that calls the service method and formats the response.
    server.tool( 'aiQrcode', '图片处理-二维码识别-识别存储桶内二维码图片内容', { objectKey: z .string() .describe('COS对象键(完整路径)示例: images/qrcode.jpg'), }, async ({ objectKey }) => { const res = await CIAIInstance.aiQrcode(objectKey); return { content: [ { type: 'text', text: JSON.stringify(res.data, null, 2), }, ], isError: !res.isSuccess, }; }, );
  • Zod schema definition for the aiQrcode tool input parameter 'objectKey'.
    { objectKey: z .string() .describe('COS对象键(完整路径)示例: images/qrcode.jpg'), },
  • Instantiation of the CIAIService instance used by the aiQrcode tool.
    const CIAIInstance = new CIAIService(bucket, region, cos);

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/xiaomizhoubaobei/MCP'

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