MCP server for image generation via OpenRouter using the Nanobanana 2 (Gemini 3.1 Flash Image Preview) model. Provides tools for generating and editing images through natural language prompts.
Two well-defined image tools with complete JSON schemas, clear descriptions, and proper parameter constraints. Both tools have enum-constrained aspect_ratio and image_size parameters, descriptions exceeding 100 chars, and documented return types. Naming is verb-first and action-clear (generate_image, edit_image). However, descriptions lack explicit guidance on when to use each tool vs. the other, error recovery paths are not documented in tool descriptions, and output schema documentation is implicit rather than explicit in the tool definition.
Edit an existing image using natural language instructions via Nanobanana 2 (Gemini 3.1 Flash Image) on OpenRouter. Takes a base64-encoded input image and returns the edited image as a base64 data URL. Args: - prompt (string): Instructions describing how to edit the image - input_image_base64 (string): Base64-encoded data URL of the input image (e.g. data:image/png;base64,...) - aspect_ratio (string, optional): Aspect ratio for the output image - image_size (string, optional): Resolution - 0.5K, 1K (default), 2K, or 4K - system_prompt (string, optional): System prompt to guide editing style Returns: Text content with the model's response, plus image content with the edited image, and the file path to the saved image on disk. Examples: - "Make the background blurred and add a sunset glow" - "Change the person's hair color to blue and add a crown" with image_size "2K" - "Remove the text from the image and enhance colors"
Generate an image from a text prompt using Nanobanana 2 (Gemini 3.1 Flash Image) via OpenRouter. Returns the generated image as a base64 data URL along with any text the model provides. Args: - prompt (string): Text description of the image to generate - aspect_ratio (string, optional): One of 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1 - image_size (string, optional): Resolution - 0.5K, 1K (default), 2K, or 4K - system_prompt (string, optional): System prompt to guide style/behavior Returns: Text content with the model's response, plus image content with the generated image, and the file path to the saved image on disk. Examples: - "A cat wearing a top hat in watercolor style" - "Professional headshot photo, studio lighting, neutral background" with aspect_ratio "3:4" - "Wide panoramic landscape of mountains at sunset" with aspect_ratio "21:9" and image_size "4K"
Output schema not formally documented in tool definitions. Descriptions mention 'returns text content with model response, plus image content, and file path' but lack structured schema declaration (e.g., {type: object, properties: {text, images, file_path}}).
No error recovery guidance in tool descriptions. Descriptions do not explain what to do if API rate limits are hit, credits are insufficient, or the model fails. Error handling exists in code but is not surfaced to LLM via tool description.
No distinction between generate_image and edit_image in descriptions. LLM cannot infer from descriptions alone when to use generation vs. editing. Descriptions should clarify: 'Use generate_image to create from scratch; use edit_image to modify an existing image.'
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | 2026-07-28+ | v2 |
input_image_base64 parameter in edit_image lacks format guidance. Description says 'data:image/png;base64,...' but does not specify: must be a valid data URL, what image formats are supported, or max size. LLM may pass invalid formats.
OPENROUTER_API_KEY exposed as environment variable with no server-side secret injection pattern. While not a tool parameter (good), the error message 'OPENROUTER_API_KEY environment variable is required' leaks the secret name into logs.