Fetch Images
fetch-imagesFetch images from URLs or local file paths, optionally compress and resize, and return as resource links, image content, or structured JSON.
Instructions
Fetch and process images from URLs or local file paths. Returns MCP CallToolResult with content[] (ResourceLink or ImageContent based on tool_result param) and structuredContent (OpenAI ImagesResponse format with data[].url, data[].path, or data[].b64_json based on response_format param).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | No | Array of image sources: HTTP(S) URLs or file paths (absolute or relative to the first MEDIA_GEN_DIRS entry). Max 20 images. Mutually exclusive with 'n'. | |
| ids | No | Array of image IDs to fetch by filename match (looks for filenames containing _{id}_ or _{id}. under the primary MEDIA_GEN_DIRS[0] directory). Mutually exclusive with 'sources' and 'n'. | |
| n | No | When set, returns the last N image files from the primary MEDIA_GEN_DIRS[0] directory (most recently modified first). Mutually exclusive with 'sources'. | |
| compression | No | Compression options. If omitted, no compression is applied. | |
| tool_result | No | Controls content[] shape: 'resource_link' (default) emits ResourceLink items, 'image' emits base64 ImageContent blocks. | resource_link |
| response_format | No | Controls structuredContent shape: 'url' (default) emits data[].url, 'path' emits data[].path, 'b64_json' emits data[].b64_json. | url |
| file | No | Base path for output files, absolute or relative to the first MEDIA_GEN_DIRS entry. If multiple images, index suffix is added. |