Skip to main content
Glama

imageInfo

Extract metadata and technical details from images stored in cloud storage to analyze file properties and dimensions.

Instructions

图片处理-获取图片信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectKeyYes图片在存储桶里的路径

Implementation Reference

  • The core handler function in CIPicService that performs the COS 'imageInfo' request to retrieve 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 tool registration for 'imageInfo', defining name, description, input schema, and handler wrapper that calls the service method.
    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,
        };
      },
    );
  • Input schema validation using Zod for the 'objectKey' parameter.
    {
      objectKey: z.string().describe('图片在存储桶里的路径'),
    },

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