Skip to main content
Glama
keizman

MCP Feedback Collector

by keizman

get_image_info

Extract image metadata including dimensions and format from a specified file path to support feedback collection with visual content analysis.

Instructions

获取指定路径图片的信息(尺寸、格式等)

Args:
    image_path: 图片文件路径

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_pathYes

Implementation Reference

  • The handler function for the 'get_image_info' MCP tool. It uses PIL to open the image at the given path, extracts metadata like format, mode, size, dimensions, and file size, and returns a formatted string with the information. Registered via @mcp.tool() decorator.
    @mcp.tool()
    def get_image_info(image_path: str) -> str:
        """
        获取指定路径图片的信息(尺寸、格式等)
        
        Args:
            image_path: 图片文件路径
        """
        try:
            image_path = Path(image_path)
            if not image_path.exists():
                return f"图片文件不存在: {image_path}"
                
            with Image.open(image_path) as img:
                info = {
                    "path": str(image_path),
                    "format": img.format,
                    "mode": img.mode,
                    "size": img.size,
                    "width": img.width,
                    "height": img.height,
                }
                
                # 尝试获取文件大小
                file_size = image_path.stat().st_size
                info["file_size_bytes"] = file_size
                info["file_size_mb"] = round(file_size / (1024 * 1024), 2)
                
                return f"图片信息: {info}"
        except Exception as e:
            return f"获取图片信息失败: {str(e)}"
  • The @mcp.tool() decorator registers the get_image_info function as an MCP tool.
    @mcp.tool()
  • Input schema defined by function signature (image_path: str) and docstring Args section.
    def get_image_info(image_path: str) -> str:
        """
        获取指定路径图片的信息(尺寸、格式等)
        
        Args:
            image_path: 图片文件路径
        """
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it implies a read-only operation ('get information'), it doesn't specify whether this requires file system access, what happens with invalid paths, error conditions, or performance characteristics. The description adds minimal behavioral context beyond the basic purpose.

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 appropriately concise with two sentences: one stating the purpose and another documenting the parameter. The structure is clear and front-loaded with the main functionality, though the Chinese-to-English translation creates minor redundancy in the parameter documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read operation with no output schema, the description provides adequate basic information about what the tool does and what parameter it requires. However, it lacks details about return values, error handling, and behavioral constraints that would be helpful given the absence of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explicitly documents the single parameter 'image_path' and its purpose ('图片文件路径' meaning 'image file path'), adding meaningful semantics beyond the schema which has 0% description coverage. This fully compensates for the schema gap for this single-parameter tool.

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

Purpose4/5

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

The description clearly states the tool's purpose: '获取指定路径图片的信息(尺寸、格式等)' translates to 'Get information about the specified image path (dimensions, format, etc.)'. This provides a specific verb ('get information') and resource ('image'), though it doesn't explicitly differentiate from sibling tools like 'pick_image'.

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 like 'pick_image' or 'collect_feedback'. It simply states what the tool does without context about appropriate use cases or exclusions.

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/keizman/mcp-feedforward'

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