Skip to main content
Glama

mcp_gemini_generate_images

Generate high-quality images using text prompts with Google Imagen models, supporting customizable parameters like size, quantity, and file naming for efficient image creation.

Instructions

Google Imagen 모델을 사용하여 이미지를 생성합니다. 곧 mcp_gemini_generate_image 도구로 대체될 예정입니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNameNo저장할 이미지 파일 이름 (확장자 제외)imagen-1755209535150
modelNo사용할 모델 ID (예: imagen-3.0-generate-002)imagen-3.0-generate-002
numberOfImagesNo생성할 이미지 수 (1-4)
promptYes이미지 생성을 위한 텍스트 프롬프트
saveDirNo이미지를 저장할 디렉토리./temp
sizeNo생성할 이미지 크기1024x1024

Implementation Reference

  • MCP tool handler for 'mcp_gemini_generate_images' that calls geminiService.generateImage, serializes the result as JSON, and handles errors.
    async handler(args: any): Promise<ToolResponse> {
      try {
        // 기존 호환성을 위해 generateImage 함수 호출
        const result = await geminiService.generateImage(args);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Gemini 이미지 생성 오류: ${error instanceof Error ? error.message : String(error)}`
          }]
        };
      }
    }
  • Input schema defining parameters for the mcp_gemini_generate_images tool including model, prompt, number of images, size, save directory, and filename.
    inputSchema: {
      type: 'object',
      properties: {
        model: {
          type: 'string',
          description: '사용할 모델 ID (예: imagen-3.0-generate-002)',
          default: 'imagen-3.0-generate-002',
        },
        prompt: {
          type: 'string',
          description: '이미지 생성을 위한 텍스트 프롬프트',
        },
        numberOfImages: {
          type: 'number',
          description: '생성할 이미지 수 (1-4)',
          default: 1,
          minimum: 1,
          maximum: 4,
        },
        size: {
          type: 'string',
          description: '생성할 이미지 크기',
          default: '1024x1024',
        },
        saveDir: {
          type: 'string',
          description: '이미지를 저장할 디렉토리',
          default: './temp',
        },
        fileName: {
          type: 'string',
          description: '저장할 이미지 파일 이름 (확장자 제외)',
          default: `imagen-${Date.now()}`,
        },
      },
      required: ['prompt']
    },
  • Registration of the mcp_gemini_generate_images tool in the main tools export array used by the MCP server.
    {
      name: 'mcp_gemini_generate_images',
      description: 'Google Imagen 모델을 사용하여 이미지를 생성합니다. 곧 mcp_gemini_generate_image 도구로 대체될 예정입니다.',
      inputSchema: {
        type: 'object',
        properties: {
          model: {
            type: 'string',
            description: '사용할 모델 ID (예: imagen-3.0-generate-002)',
            default: 'imagen-3.0-generate-002',
          },
          prompt: {
            type: 'string',
            description: '이미지 생성을 위한 텍스트 프롬프트',
          },
          numberOfImages: {
            type: 'number',
            description: '생성할 이미지 수 (1-4)',
            default: 1,
            minimum: 1,
            maximum: 4,
          },
          size: {
            type: 'string',
            description: '생성할 이미지 크기',
            default: '1024x1024',
          },
          saveDir: {
            type: 'string',
            description: '이미지를 저장할 디렉토리',
            default: './temp',
          },
          fileName: {
            type: 'string',
            description: '저장할 이미지 파일 이름 (확장자 제외)',
            default: `imagen-${Date.now()}`,
          },
        },
        required: ['prompt']
      },
      async handler(args: any): Promise<ToolResponse> {
        try {
          // 기존 호환성을 위해 generateImage 함수 호출
          const result = await geminiService.generateImage(args);
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(result, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `Gemini 이미지 생성 오류: ${error instanceof Error ? error.message : String(error)}`
            }]
          };
        }
      }
    },
  • Core helper method in GeminiService that implements image generation logic, dispatching to Imagen or Gemini specific methods based on model.
    async generateImage({
      model,
      prompt,
      numberOfImages,
      aspectRatio,
      personGeneration,
      saveDir = './temp',
      fileName,
    }: {
      model: string;
      prompt: string;
      numberOfImages?: number;
      aspectRatio?: string;
      personGeneration?: string;
      saveDir?: string;
      fileName?: string;
    }) {
      try {
        // Imagen 모델을 사용하는 경우
        if (model.startsWith('imagen-')) {
          return await this.generateImageWithImagen({
            model,
            prompt,
            numberOfImages,
            aspectRatio,
            personGeneration,
            saveDir,
            fileName,
          });
        }
    
        // Gemini 모델이면서 이미지 편집 모델을 사용하는 경우
        if (model.endsWith('-image-generation-editing')) {
          return await this.generateImageWithGeminiEdit({
            model,
            prompt,
            saveDir,
            fileName,
          });
        }
    
        // 기본적으로 Gemini 모델을 사용
        return await this.generateImageWithGemini({
          model,
          prompt,
          saveDir,
          fileName,
        });
      } catch (error) {
        throw this.formatError(error);
      }
    }
  • src/index.ts:47-47 (registration)
    Tool capability registration in MCP server initialization (currently disabled).
    mcp_gemini_generate_images: false,
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool generates images but lacks critical behavioral details: it doesn't mention whether this is a read-only or destructive operation, any authentication requirements, rate limits, or what the output looks like (e.g., file paths, error handling). The deprecation warning adds some context but doesn't cover core behavioral traits.

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

Conciseness4/5

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

The description is concise with two sentences: one states the purpose, and the other provides a deprecation warning. It's front-loaded with the core function, and both sentences earn their place by adding value (purpose and context). However, it could be slightly more structured by explicitly separating usage notes.

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

Completeness2/5

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

Given the complexity (image generation tool with 6 parameters, no annotations, and no output schema), the description is incomplete. It lacks details on behavioral aspects (e.g., side effects, permissions), output handling (e.g., what's returned), and differentiation from siblings. The deprecation note adds some context but doesn't fill these gaps, making it inadequate for a tool of this nature.

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 fully documents all 6 parameters (e.g., prompt, model, size). The description adds no parameter-specific information beyond what's in the schema, such as explaining prompt best practices or model differences. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Google Imagen 모델을 사용하여 이미지를 생성합니다' (uses Google Imagen model to generate images). It specifies the verb (generate) and resource (images) with the technology (Google Imagen). However, it doesn't distinguish itself from sibling tools like 'mcp_gemini_create_image' or 'mcp_gemini_generate_image', which likely have similar functions.

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

Usage Guidelines3/5

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

The description implies usage by mentioning it will soon be replaced by 'mcp_gemini_generate_image', suggesting this is a legacy or alternative version. However, it doesn't provide explicit guidance on when to use this tool versus other image-generation siblings (e.g., 'mcp_gemini_create_image', 'mcp_imagen_generate'), nor does it mention any prerequisites or exclusions.

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

Related 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/bigdata-coss/agent_mcp'

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