generate_image
Creates an OpenAI image from a text prompt and saves it to disk, returning the file path. Set quality, size, and background for drafts, hero banners, or transparent logos.
Instructions
Generate an image with OpenAI and save it to disk. Returns the saved file path.
QUALITY - choose carefully, higher quality costs much more:
"low" (default) drafts, previews, trying out ideas, placeholders.
"medium" decent images for normal use when low looks too rough.
"high" ONLY for final assets the user explicitly wants in high quality, or after a low-quality draft has been approved. Never use "high" for experiments or multiple variations.
size: 1024x1024 square, 1536x1024 landscape (hero banners), 1024x1536 portrait. background: "transparent" for logos/icons/stickers (needs png or webp). output_path: where to save, ideally an absolute path inside the user's project, e.g. "/Users/me/site/images/hero.png" or "C:\Users\me\site\hero.png". ~ and environment variables are expanded. A folder gets an auto-named file; a relative path is saved inside the default folder. If omitted, saves to the user's Pictures folder. model: override the default model (normally leave empty).
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": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | 1024x1024 | |
| model | No | ||
| prompt | Yes | ||
| quality | No | low | |
| background | No | auto | |
| output_path | No | ||
| output_format | No | png |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |