MCP server for generating images using Google's Gemini AI models (Imagen and Veo)
MediaGeneratorServer has 2 tools with visible schemas and descriptions, but critical gaps reduce overall quality. Both tools have descriptions (>20 chars), proper parameter type definitions, and structured input schemas. However, they suffer from: (1) compound naming ('generate_and_save_image', 'generate_images_from_list') combining two responsibilities; (2) missing output schema documentation in code; (3) limited error guidance, exceptions caught but responses are unstructured error strings rather than actionable recovery guidance; (4) no per-parameter validation described or demonstrated; (5) no enumeration constraints for 'model_name' or 'aspect_ratio' despite fixed valid sets. Parameter descriptions are present but lack clarity on constraints (e.g., 'number_of_images' allows 1-4 per description, but no validation shown). Error handling returns raw exception strings ('An error occurred during image generation or saving: {e}') rather than classified, actionable recovery guidance. The server lacks tool-composition patterns, two tools operate on the same resource (image generation) and should be decomposed further.
Generates an image using a generic model and saves it to the filesystem.
Generates multiple images from a list of prompts and saves them to the filesystem.
Tool names violate single-responsibility principle: 'generate_and_save_image' combines two actions (generate + save); 'generate_images_from_list' is generic (what if you don't want to save?). Names containing 'and' signal multiple responsibilities.
No enumeration constraints for 'model_name' parameter despite fixed valid set (imagen-3, imagen-4, imagen-4-ultra, veo-2). Free-form string invites hallucinated values. Code validates against enum (line: 'if model_name == "imagen-3"...') but schema does not enforce it.
No enumeration constraint for 'aspect_ratio' parameter despite documented valid set (1:1, 3:4, 4:3, 9:16, 16:9). Parameter description lists values but schema does not enforce enum.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 45 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 33 | - | v1 |
Error responses are unstructured raw exception strings: 'An error occurred during image generation or saving: {e}'. No error classification (retryable vs. fatal), no recovery guidance, no actionable hints. LLM receives no signal for what to do next.
Output schema not documented in code or docstrings. Function returns 'str' (filepath) for generate_and_save_image and 'List[str]' for generate_images_from_list. LLM does not know: is it always a valid path? Can it contain error messages? What fields would a structured response contain?
Parameter 'number_of_images' accepts 1-4 per docstring but no min/max constraints visible in schema definition. Unbounded integer allows LLM to pass invalid values (0, 5, 1000).
No input validation shown before API call. LLM can pass null/empty 'prompt', invalid 'model_name', or out-of-range 'number_of_images'. Error handling is downstream (try/except) rather than early validation with clear messages.
Filepath parameter accepts nullable string. Default behavior creates timestamped file (good), but description says 'Defaults to GENERATED_IMAGES_DIR/[timestampped_random_filename].png', typo 'timestampped', and this is a code comment, not a user-facing constraint description.