Images: place, optimise and view photos, and stock photos
imagesFor reading use images_read, which is read-only and needs no approval: "view", "stock", "status" here are deprecated (still works). Images for the site: the owner's photos, files saved with fs_import and licensed stock photos. Needs no key and costs nothing. "status": what works, the account's image settings and what to do in your app. "view": look at images in the project (paths: files or a folder such as "data/import"): one comes back at 800 px, several as a numbered contact sheet, each with its real size, orientation (after the EXIF turn), file size, dominant colour and the slot the owner uploaded it for. "place": a photo in the project (from: the owner's, or one saved with fs_import) into its slot on a page (file: the page; slot: the data-lf-placeholder label or "#id"; alt: what this photo shows): makes the web versions at the slot's widths, cropped to its shape (its aspect class or width and height, or aspect: "4:3"; focus), and in an HTML page sets the 's src, srcset, sizes, width, height and alt and removes data-lf-placeholder, changing nothing else (a marked box named or shaped like a photo, or a div role="img" becomes an that keeps its class and style); for a component file (JSX, Vue, …) it returns the tag to put in and its line (a div role="img" stand-in counts as a slot). "edit" operation "optimise": any image in the project (from), sized to max_width and compressed for the web; widths: [800, 1600] makes every width a srcset needs in one call and returns the srcset and the ; aspect: "4:3" crops it to that shape first. Deprecated, going on 2027-02-09: "generate", "style" and the edit operations other than optimise (remove_background, vectorize, crisp_upscale, creative_upscale, replace_background, variations), which make or change images with Recraft on the account's own Recraft key (Account › Images); until then they still work for an account with a key, when the user asks for Recraft, and its costs are theirs. "stock": licensed photos from Unsplash, with no key or cost to the user (query: the mood or scenery; orientation, color, page): one numbered list with small previews to choose from, each marked by its id ("unsplash:…"); at most two searches per image slot. "stock_use": for every stock photo you put on the site (photo_id as listed, used_on e.g. "home hero", alt): records its credit for the owner and returns the to put in. An Unsplash photo is hotlinked (never save it into the project). No credit is needed on the site. Stock sets the mood and scenery (landscape, town, coast, food in general, textures); it never stands in for the owner's own rooms, work, products, team or customers: those stay data-lf-placeholder until their photos arrive.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>",
"project": "<project>"
},
"name": "images"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| alt | No | stock_use, place, edit optimise: alt text: what this photo shows (look at it with view first). | |
| file | No | place: the page file with the slot, e.g. "workspace/site/index.html". | |
| from | No | edit, place: the image in the project (place: the owner's photo). | |
| page | No | stock: the next results. | |
| size | No | generate/variations: "16:9", "1:1", "1536x768"… | |
| slot | No | place: which data-lf-placeholder to fill: its label (or a unique part of it) or "#id". Left out on a page with one photo slot; a wrong one lists the page's slots. | |
| trim | No | Cut the empty margin around the subject (cutouts, logos, icons; an SVG's viewBox is fitted to the drawing). | |
| color | No | stock: a colour filter. | |
| focus | No | place, edit optimise with aspect: what the crop to the shape keeps (auto: the most interesting part); none keeps the photo's own shape (place without aspect). | |
| paths | No | view: images in the project, or folders (e.g. ["data/import"]); up to 24 images. | |
| query | No | stock: the mood or scenery, e.g. "misty mountain valley at dawn". | |
| sizes | No | edit optimise, place: the <img> sizes, e.g. "(min-width: 52rem) 45vw, 100vw" (place defaults to the slot's data-lf-sizes, then what its layout classes say, then 100vw, and says which). | |
| style | No | generate: false to skip the project's Recraft style (the look's colours still apply; colors: false skips those). | |
| action | Yes | ||
| aspect | No | place, edit optimise: the shape to crop to, width:height ("4:3", "16:9", "1:1") or a number (1.5). place defaults to the slot's shape (an aspect-[4/3], aspect-video or aspect-ratio on it, else its width and height). | |
| colors | No | generate: false to skip the chosen look's colours and background. | |
| prompt | No | generate (deprecated): what to draw. edit replace_background (deprecated): the new background. | |
| source | No | stock: unsplash. | |
| vector | No | generate: SVG instead of a raster image. | |
| widths | No | edit optimise, place: the widths to make (e.g. [800, 1600]), one file each (name-800.webp, …). place defaults to the slot's data-lf-widths, else its size and twice it. | |
| confirm | No | ||
| project | Yes | Project slug or id. | |
| save_to | No | Where to save, e.g. "workspace/public/images/hero.webp" (the extension is adjusted to the format). | |
| used_on | No | stock_use: where on the site, in words the owner reads in their portal, e.g. "Home page, top photo", "Find us: the harbour". | |
| photo_id | No | stock_use: an id from stock's list, e.g. "unsplash:Ab-9". | |
| replaces | No | stock_use: the stock photo it takes the place of there (dropped from the credits). | |
| max_width | No | Widest the saved image may be, in pixels (default 1920: a full-width hero; 800 suits a card, 256 an avatar). Images are compressed for the web either way. | |
| operation | No | edit: what to do. | |
| references | No | style: reference images in the project. | |
| orientation | No | stock. | |
| transparent | No | SVGs: remove the background shape so the page shows through. | |
| keep_original | No | Also save the full-quality original beside it ("-original"), for print or later cropping. |