Zum Hauptinhalt springen

MCP-Tools

Der nano-banana MCP Server exposed vier Tools. Sie zielen alle auf dieselben pipeline-core-Helper, die auch die Web-App nutzt — das Verhalten ist also identisch, egal wer den Call auslöst.

propose_concepts

Synchron. Verwandelt eine grobe Idee in ein stilistisch kohärentes visuelles Concept, mit refined Prompt + thematischen Keywords + einer id der Form <pipelineId>#0, die man via concept_id zurück in generate_image füttern kann.

{
"prompt": "marketing hero for our gemini enterprise launch",
"conversationId": "optional, for stitching multi-turn sessions"
}

Returns:

{
"pipelineId": "abc-123",
"concepts": [
{
"id": "abc-123#0",
"title": "Translucent prism",
"refined_prompt": "…full styled prompt the diffusion model will see…",
"keywords": ["isometric", "translucent", "blue"]
}
]
}

concepts ist heute immer ein einelementiges Array — der Architect emittiert pro Call ein refined Concept. Wer alternative Richtungen erkunden will, ruft propose_concepts mit einem leicht veränderten Prompt nochmal auf; wer visuelle Varianten desselben Concepts will, nutzt generate_image_async mit iterations: 2..4 auf der zurückgegebenen id.

generate_image (synchron)

Blockt bis zu 180 Sekunden, während die Pipeline läuft, streamt Progress-Notifications und liefert am Ende final signed GCS URLs zurück. Am besten für interaktive Flows, in denen ein Mensch aktiv zuschaut.

{
"prompt": "raw user prompt (optional if concept_id provided)",
"concept_id": "abc-123#0 (optional, supersedes prompt)",
"refinement": "optional free-text tweak applied on top of concept",
"aspectRatio": "1:1 | 16:9 | 9:16 | 4:3 | 3:4",
"iterations": 1,
"enhance": true,
"resolution": "1k | 2k | 4k"
}

Returns:

{
"images": [
{
"pipeline_id": "def-456",
"status": "completed",
"results": [
{ "image": "<7d signed GCS URL>", "image_uri": "gs://...", "thumbnail": "..." }
]
}
],
"duration_ms": 47213
}

generate_image_async

Gleiches Input-Schema wie generate_image, kommt aber sofort mit pipeline_ids zurück. Sinnvoll, wenn man mehrere Pipelines fire-and-forget anstoßen und parallel pollen will, oder wenn das Modell währenddessen frei bleiben soll.

Returns:

{ "pipeline_ids": ["def-456", "def-457"], "status": "running" }

get_image

Snapshot oder Long-Poll auf eine einzelne Pipeline.

{ "pipeline_id": "def-456", "wait_seconds": 270 }
  • wait_seconds: 0 (Default): Instant-Snapshot.
  • wait_seconds: 1..270: blockt bis zu N Sekunden, kommt zurück, sobald Status auf completed oder failed springt (oder die Deadline läuft ab).

Returns:

{
"pipeline_id": "def-456",
"status": "running",
"progress_percent": 60,
"stage": "enhance-image",
"results": []
}

Tool-Auswahl auf einen Blick

SzenarioTool-Kombination
"Mach mir ein Bild von X"generate_image (roher Prompt, wird via Prompt Engineer gestyled)
"Zeig mir erstmal eine Richtung"propose_concepts → User akzeptiert/refined → generate_image (concept_id)
Bulk-Varianten parallelgenerate_image_async (iterations: 4) → warten → get_image
Langläufer, der Client-Restart überlebtgenerate_image_asyncget_image mit wait_seconds