Skip to main content
Glama

set_model

Configure the Gemini AI model for image generation sessions, choosing between 'flash' for speed or 'pro' for enhanced quality outputs.

Instructions

Set the Gemini model for this session. 'flash' for faster generation (default), 'pro' for higher quality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel to use: 'flash' (gemini-3.1-flash-image-preview) or 'pro' (gemini-3-pro-image-preview)
conversation_idNoSession ID to apply this setting to (default: 'default')

Implementation Reference

  • Handler implementation for the 'set_model' tool. It updates the `selectedModel` property in the session context.
    case "set_model": {
      const { model, conversation_id = "default" } = args as any;
    
      const modelMap: Record<string, ModelOption> = {
        "flash": "gemini-3.1-flash-image-preview",
        "pro": "gemini-3-pro-image-preview",
      };
    
      if (!modelMap[model]) {
        return {
          content: [{
            type: "text",
            text: `Invalid model: ${model}. Use 'flash' or 'pro'.`,
          }],
          isError: true,
        };
      }
    
      const context = getOrCreateContext(conversation_id);
      context.selectedModel = modelMap[model];
    
      return {
        content: [{
          type: "text",
          text: `✓ Model set to ${model} (${modelMap[model]}) for session: ${conversation_id}`,
        }],
      };
    }
  • src/index.ts:441-458 (registration)
    Tool registration definition for 'set_model' including input schema.
      name: "set_model",
      description: "Set the Gemini model for this session. 'flash' for faster generation (default), 'pro' for higher quality.",
      inputSchema: {
        type: "object",
        properties: {
          model: {
            type: "string",
            enum: ["flash", "pro"],
            description: "Model to use: 'flash' (gemini-3.1-flash-image-preview) or 'pro' (gemini-3-pro-image-preview)",
          },
          conversation_id: {
            type: "string",
            description: "Session ID to apply this setting to (default: 'default')",
          },
        },
        required: ["model"],
      },
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that this affects session configuration and mentions default behavior, but doesn't cover important behavioral aspects like whether this persists across sessions, requires specific permissions, or has rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste - the first states the purpose, the second provides usage guidance. Every word earns its place, and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a configuration tool with 2 parameters and 100% schema coverage but no annotations or output schema, the description is reasonably complete. It explains what the tool does and provides practical guidance, though it could benefit from more behavioral context given the absence of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description adds minimal value beyond the schema by mentioning the performance characteristics of each model option, but doesn't provide additional parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Set') and resource ('Gemini model for this session'), distinguishing it from siblings like gemini_chat or set_aspect_ratio. It specifies the exact configuration being modified.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use each option ('flash' for faster generation, 'pro' for higher quality) and indicates the default. However, it doesn't explicitly state when NOT to use this tool or mention alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pistachiomatt/nanobanana-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server