Generate Image
generate_imageCreate or edit images from a text prompt using Google Gemini, with optional reference images to guide the output. Save results to a directory or return them inline.
Instructions
Generate or edit images using Google Gemini. Provide a text prompt describing what you want. Optionally include one or more reference images to inform the output (e.g. edit a photo, restyle an icon, combine references).
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 |
|---|---|---|---|
| images | No | Optional reference images — file paths, data URLs, or raw base64 strings. The model uses these to inform the output. | |
| prompt | Yes | Text prompt describing the image to generate or how to edit the reference image(s) | |
| output_dir | No | Directory to save generated images. If omitted, images are returned inline. | |
| output_name | No | Filename prefix for saved images (without extension) | generated |
| google_api_key | No | Google AI Studio API key. Falls back to GOOGLE_API_KEY env var. |