genmedia Image
This skill generates images by calling the nanobanana_image_generation tool
exposed by the genmedia Nanobanana MCP server. It is a single-purpose skill:
one tool, one job. It supports both local workspace execution and remote / managed
agent execution via GCS staging, and it always verifies that a real artifact was
produced — never that the call merely returned without error.
Prerequisite: the genmedia Nanobanana MCP server must already be configured
in your client (e.g. via this plugin's mcp.json / .mcp.json, or a manual MCP
config). The server needs GOOGLE_CLOUD_PROJECT and Application Default
Credentials (ADC) in its environment for Vertex AI calls.
Instructions
Resolve Output Storage Mode:
- Local Mode (Default): Pass
output_directory pointing to the target
local workspace directory. The artifact is written to that local path.
- Managed Agent / GCS Mode: When executing inside a managed agent
container where the MCP server runs remotely on Cloud Run, pass
gcs_bucket_uri (a GCS URI prefix such as your-bucket/outputs/) — or set
the GENMEDIA_BUCKET environment variable — pointing to the mounted GCS
environment bucket.
- Do not pass both modes' destinations for the same call unless you
intentionally want output in both places.
Formulate Imagery Parameters:
prompt (required): a detailed text description. Favor concrete style,
subject, lighting, and composition language (e.g. "a photorealistic red
panda sitting in a bamboo forest, golden hour lighting").
model (optional): defaults to gemini-3.1-flash-image. Leave unset
unless you have a specific model requirement.
aspect_ratio (optional): defaults to 1:1. Supported ratios are
model-dependent (common values include 1:1, 3:4, 4:3, 9:16,
16:9). Choose the ratio that matches the intended use (e.g. 16:9 for a
hero banner, 9:16 for a vertical/mobile frame).
image_size (optional): 1K, 2K, or 4K. Defaults to 1K when
unset. Supported sizes are model-dependent.
output_filename (optional): a client-predictable base name (e.g.
hero.png). The extension is forced to the true output media type. When a
single image is produced the name is used as-is; when multiple images are
produced they are suffixed _1, _2, … before the extension. An existing
file/object of the same name is overwritten.
seed (optional): a non-negative integer for best-effort reproducible
generation.
Reference Images (optional, images):
- To guide generation with existing media, pass
images as a list of
local file paths or GCS URIs (images, and — where the model supports it
— videos or PDFs). Use this for edits, style transfer, character
consistency, or compositing from source frames.
- Ensure every referenced path/URI actually exists before the call; a
missing reference produces a degraded or failed result.
Invoke the tool:
- Call
nanobanana_image_generation with the parameters assembled above.
- Local Mode example params:
{ "prompt": "...", "aspect_ratio": "16:9", "output_directory": "./out", "output_filename": "hero.png" }
- GCS Mode example params:
{ "prompt": "...", "aspect_ratio": "16:9", "gcs_bucket_uri": "your-bucket/outputs/", "output_filename": "hero.png" }
- Reference-guided example params:
{ "prompt": "same character, new pose", "images": ["./refs/character.png"], "output_directory": "./out", "output_filename": "pose.png" }
Verify the Artifact By Existence (do not trust the response alone):
- A tool call that returns without an error is not proof an image was
written. In some clients and in GCS mode the server returns a
resource_link content type that cannot be rendered even though the file
was written — never assume inline data.
- Local Mode: confirm the file exists and is a real, non-empty image, and
inspect its type:
file "<output_directory>/<output_filename>" # e.g. "... PNG image data, 1024 x 1024"
- GCS Mode: confirm the object exists at the destination prefix by
listing it — do not parse the tool response:
gcloud storage ls "gs://<gcs_bucket_uri prefix>"
Note: if you relied on the GENMEDIA_BUCKET environment variable instead of
passing gcs_bucket_uri explicitly, the server writes under a
nanobanana_outputs/ subprefix — list gs://<GENMEDIA_BUCKET>/nanobanana_outputs/,
not the bare bucket.
- If no artifact is found, treat the generation as failed and surface the
tool response for debugging rather than reporting success.
1---2name: genmedia-image3description: Generate images from a text prompt (optionally guided by reference images) using the genmedia Nanobanana MCP server's nanobanana_image_generation tool. Use when a task needs a still image produced from a description, with control over aspect ratio, resolution, and local vs GCS output, and verified by confirming the artifact was actually written.4license: Apache-2.05---67# genmedia Image89This skill generates images by calling the `nanobanana_image_generation` tool10exposed by the genmedia **Nanobanana** MCP server. It is a single-purpose skill:11one tool, one job. It supports both local workspace execution and remote / managed12agent execution via GCS staging, and it always verifies that a real artifact was13produced — never that the call merely returned without error.1415**Prerequisite:** the genmedia Nanobanana MCP server must already be configured16in your client (e.g. via this plugin's `mcp.json` / `.mcp.json`, or a manual MCP17config). The server needs `GOOGLE_CLOUD_PROJECT` and Application Default18Credentials (ADC) in its environment for Vertex AI calls.1920## Instructions21221. **Resolve Output Storage Mode:**23 * **Local Mode (Default):** Pass `output_directory` pointing to the target24 local workspace directory. The artifact is written to that local path.25 * **Managed Agent / GCS Mode:** When executing inside a managed agent26 container where the MCP server runs remotely on Cloud Run, pass27 `gcs_bucket_uri` (a GCS URI prefix such as `your-bucket/outputs/`) — or set28 the `GENMEDIA_BUCKET` environment variable — pointing to the mounted GCS29 environment bucket.30 * Do not pass both modes' destinations for the same call unless you31 intentionally want output in both places.32332. **Formulate Imagery Parameters:**34 * **`prompt`** (required): a detailed text description. Favor concrete style,35 subject, lighting, and composition language (e.g. *"a photorealistic red36 panda sitting in a bamboo forest, golden hour lighting"*).37 * **`model`** (optional): defaults to `gemini-3.1-flash-image`. Leave unset38 unless you have a specific model requirement.39 * **`aspect_ratio`** (optional): defaults to `1:1`. Supported ratios are40 model-dependent (common values include `1:1`, `3:4`, `4:3`, `9:16`,41 `16:9`). Choose the ratio that matches the intended use (e.g. `16:9` for a42 hero banner, `9:16` for a vertical/mobile frame).43 * **`image_size`** (optional): `1K`, `2K`, or `4K`. Defaults to `1K` when44 unset. Supported sizes are model-dependent.45 * **`output_filename`** (optional): a client-predictable base name (e.g.46 `hero.png`). The extension is forced to the true output media type. When a47 single image is produced the name is used as-is; when multiple images are48 produced they are suffixed `_1`, `_2`, … before the extension. An existing49 file/object of the same name is overwritten.50 * **`seed`** (optional): a non-negative integer for best-effort reproducible51 generation.52533. **Reference Images (optional, `images`):**54 * To guide generation with existing media, pass `images` as a list of55 **local file paths or GCS URIs** (images, and — where the model supports it56 — videos or PDFs). Use this for edits, style transfer, character57 consistency, or compositing from source frames.58 * Ensure every referenced path/URI actually exists before the call; a59 missing reference produces a degraded or failed result.60614. **Invoke the tool:**62 * Call `nanobanana_image_generation` with the parameters assembled above.63 * **Local Mode example params:**64 `{ "prompt": "...", "aspect_ratio": "16:9", "output_directory": "./out", "output_filename": "hero.png" }`65 * **GCS Mode example params:**66 `{ "prompt": "...", "aspect_ratio": "16:9", "gcs_bucket_uri": "your-bucket/outputs/", "output_filename": "hero.png" }`67 * **Reference-guided example params:**68 `{ "prompt": "same character, new pose", "images": ["./refs/character.png"], "output_directory": "./out", "output_filename": "pose.png" }`69705. **Verify the Artifact By Existence (do not trust the response alone):**71 * A tool call that returns without an error is **not** proof an image was72 written. In some clients and in GCS mode the server returns a73 `resource_link` content type that cannot be rendered even though the file74 was written — never assume inline data.75 * **Local Mode:** confirm the file exists and is a real, non-empty image, and76 inspect its type:77 ```sh78 file "<output_directory>/<output_filename>" # e.g. "... PNG image data, 1024 x 1024"79 ```80 * **GCS Mode:** confirm the object exists at the destination prefix by81 listing it — do **not** parse the tool response:82 ```sh83 gcloud storage ls "gs://<gcs_bucket_uri prefix>"84 ```85 Note: if you relied on the `GENMEDIA_BUCKET` environment variable instead of86 passing `gcs_bucket_uri` explicitly, the server writes under a87 `nanobanana_outputs/` subprefix — list `gs://<GENMEDIA_BUCKET>/nanobanana_outputs/`,88 not the bare bucket.89 * If no artifact is found, treat the generation as failed and surface the90 tool response for debugging rather than reporting success.