Skip to content

Add per-call model override parameter to MCP tools #44

Description

@aborruso

Currently, the model used for image generation is fixed at server startup via the NANOBANANA_MODEL environment variable (falling back to gemini-2.5-flash-image). There is no way to switch models on a per-request basis without restarting the server.

Proposed change

Add an optional model parameter to all MCP tools (generate_image, edit_image, restore_image, generate_icon, generate_pattern, generate_story, generate_diagram). When provided, it overrides the server-level default for that single call.

Why it's useful

  • The default flash model is fast and sufficient for most use cases
  • For specific requests that need higher quality (e.g. gemini-3-pro-image-preview), the user can opt in per-call without changing server config
  • No breaking change — when model is omitted, behaviour is identical to today

Implementation sketch

  1. Add model?: string to ImageGenerationRequest in types.ts
  2. In imageGenerator.ts, use request.model || this.modelName in each generateContent call
  3. Expose the parameter in each tool's inputSchema in index.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions