image_info
Extract image format, dimensions, and color model details from any URL to analyze media files for processing or validation needs.
Instructions
Retrieves basic image information, including image format, size, and color model.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_url | Yes | The URL of the image. This can be a URL obtained via the GetObjectURL tool or a URL generated by other Fop tools. Length Constraints: Minimum length of 1. |
Implementation Reference
- Handler function for 'image_info' tool, including schema definition in tool_meta decorator. Processes image URL by appending 'imageInfo' FOP and returns updated URL.@tools.tool_meta( types.Tool( name="image_info", description="Retrieves basic image information, including image format, size, and color model.", inputSchema={ "type": "object", "properties": { "object_url": { "type": "string", "description": _OBJECT_URL_DESC }, }, "required": ["object_url"], }, ) ) def image_info(self, **kwargs) -> list[types.TextContent]: object_url = kwargs.get("object_url", "") if object_url is None or len(object_url) == 0: return [ types.TextContent( type="text", text="object_url is required" ) ] func = "imageInfo" object_url = utils.url_add_processing_func(auth=self.auth, url=object_url, func=func) return [ types.TextContent( type="text", text=str({ "object_url": object_url, }) ) ]
- src/mcp_server/core/media_processing/tools.py:258-268 (registration)Registers the image_info tool implementation using auto_register_tools.def register_tools(cfg: config.Config, cli: MediaProcessingService): tool_impl = _ToolImpl(cfg, cli) tools.auto_register_tools( [ tool_impl.image_scale_by_percent, tool_impl.image_scale_by_size, tool_impl.image_round_corner, tool_impl.image_info, ] )