Skip to main content
Glama
jneless
by jneless

tos_image_info

Retrieve metadata and details about images stored in Volcengine TOS object storage by specifying the bucket name and object key.

Instructions

获取图片信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes存储桶名称
object_keyYes图片对象键名

Implementation Reference

  • The main handler function for the 'tos_image_info' tool. It retrieves image metadata from TOS using the get_object API with process='image/info', parses the JSON response, and returns it structured with bucket and key info.
    async def image_info(args: Dict[str, Any]) -> List[TextContent]:
        """获取图片信息"""
        bucket_name = args["bucket_name"]
        object_key = args["object_key"]
        
        try:
            # 使用 get_object 方法通过 style 参数获取图片信息
            # 设置处理参数为 image/info
            resp = tos_client.get_object(bucket_name, object_key, process="image/info")
            image_info_data = resp.read().decode('utf-8')
            
            # 尝试解析JSON响应
            try:
                image_info_json = json.loads(image_info_data)
                result = {
                    "bucket": bucket_name,
                    "key": object_key,
                    "image_info": image_info_json,
                    "status": "success"
                }
            except json.JSONDecodeError:
                # 如果不是JSON格式,直接返回原始数据
                result = {
                    "bucket": bucket_name,
                    "key": object_key,
                    "image_info": image_info_data,
                    "status": "success",
                    "note": "返回原始格式数据"
                }
            
            return [TextContent(type="text", text=json.dumps(result, indent=2, ensure_ascii=False))]
        except Exception as e:
            return [TextContent(type="text", text=f"获取图片信息失败: {str(e)}")]
  • Registers the 'tos_image_info' tool in the MCP server's list_tools() function, including name, description, and input schema.
    Tool(
        name="tos_image_info",
        description="获取图片信息",
        inputSchema={
            "type": "object",
            "properties": {
                "bucket_name": {
                    "type": "string",
                    "description": "存储桶名称"
                },
                "object_key": {
                    "type": "string",
                    "description": "图片对象键名"
                }
            },
            "required": ["bucket_name", "object_key"]
        }
    ),
  • In the call_tool dispatcher, routes 'tos_image_info' calls to the image_info handler function.
    elif name == "tos_image_info":
        return await image_info(arguments)
  • Input schema definition for the 'tos_image_info' tool, specifying required parameters bucket_name and object_key.
    inputSchema={
        "type": "object",
        "properties": {
            "bucket_name": {
                "type": "string",
                "description": "存储桶名称"
            },
            "object_key": {
                "type": "string",
                "description": "图片对象键名"
            }
        },
        "required": ["bucket_name", "object_key"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('获取图片信息') without revealing whether this is a read-only operation, if it requires specific permissions, rate limits, error conditions, or what format the information is returned in. 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single phrase ('获取图片信息'), which is front-loaded and wastes no words. However, it might be overly terse given the lack of additional context needed for clarity and guidelines, slightly reducing its effectiveness despite efficient wording.

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 complexity of interacting with a storage system (TOS), no annotations, and no output schema, the description is incomplete. It doesn't explain what 'image information' includes (e.g., metadata, dimensions, format), potential errors, or how it differs from general object retrieval. For a tool in this context, more detail is needed to be fully helpful.

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 input schema has 100% description coverage, with clear Chinese descriptions for 'bucket_name' and 'object_key'. The description doesn't add any meaning beyond what the schema provides, such as explaining how these parameters relate to image retrieval or providing examples. With high schema coverage, the baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '获取图片信息' (Get image information) states a clear verb+resource combination, indicating this tool retrieves metadata about images. However, it doesn't distinguish itself from sibling tools like 'tos_get_object' (which might retrieve general object data) or 'tos_image_process' (which processes images), leaving ambiguity about what specific 'image information' means compared to general object retrieval.

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. It doesn't mention prerequisites (e.g., needing a bucket and object key), exclusions (e.g., not for videos), or comparisons to siblings like 'tos_get_object' for non-image objects or 'tos_video_info' for videos. Usage is implied but not explicitly stated.

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

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/jneless/tos-mcp'

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