Generate Image
generate_imageGenerates a JPEG image from a text prompt using Google Gemini and saves it to disk. Provide an optional save path to control the output location.
Instructions
Generate an image from a text prompt using Google Gemini and save the JPEG to disk.
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 |
|---|---|---|---|
| prompt | Yes | Descriptive text prompt for generating the image | |
| save_path | No | Optional path to save the JPEG image. Supports absolute or relative paths. If omitted, the server saves to IMAGE_OUTPUT_DIR or a default local output directory. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Optional text response from the model | |
| model | Yes | Gemini model used for generation | |
| file_path | Yes | Absolute path where the generated image was saved | |
| mime_type | Yes | MIME type for generated image bytes |