fetch_image
Fetches an image from a URL (absolute or relative) and returns it as base64 so the model can view it. Compresses oversized images to fit the specified size.
Instructions
Fetch an image from a URL (absolute or relative to a base page) and return it as base64 image content that the model can see. Use when a page's markdown contains relative image URLs (e.g.
) and you need to view the image. Optional compression can shrink oversized images to fit within maxSizeKB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Image URL. Can be absolute (http/https) or relative; if relative, baseUrl is required. | |
| baseUrl | No | Base/context URL to resolve a relative image URL against (the page the image was found on). | |
| compress | No | If true, an oversized image will be compressed (resized + quality-reduced, output JPEG) to fit within maxSizeKB instead of being rejected. | |
| maxSizeKB | No | Max image size in KB to return (rejects or compresses larger images). | |
| compressQuality | No | JPEG quality percentage when compressing (1-100, default 75). Lower = smaller file. | |
| compressMaxWidth | No | Maximum width in pixels when compressing (preserves aspect ratio). | |
| compressMaxHeight | No | Maximum height in pixels when compressing (preserves aspect ratio). |