Skip to main content
Glama

Generar imagen (OpenAI GPT Image)

generar_imagen

Generates an image from an English prompt via OpenAI, saves it to disk, and returns a file_path for Pipefy upload. Errors return explicit type, code, and message, never a blank image.

Instructions

Genera una imagen desde cero a partir de un prompt en inglés con la API de OpenAI. Guarda el archivo en disco y devuelve su ruta (file_path) para adjuntarla a Pipefy con upload_file_path. Si OpenAI rechaza el prompt o la llamada falla, devuelve error explícito (tipo_error, código, mensaje) — nunca una imagen vacía.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoCantidad de variantes (1-10). Default 1.
sizeNocuadrada (1024x1024, default) | apaisada (1536x1024, 3:2) | vertical (1024x1536, 2:3) | auto. Con gpt-image-2+ también ANCHOxALTO libre (múltiplos de 16, proporción 1:3–3:1, ej. 1280x720 o 1536x864).
modelNoModelo de OpenAI. Default: gpt-image-2. Ej: gpt-image-2, gpt-image-2.5-flare, gpt-image-1.5, gpt-image-1-mini.
promptYesPrompt en inglés. Se envía tal cual a OpenAI (incluye aquí colores/estilo de marca).
crop_toNoRecorta/redimensiona el resultado a estas dimensiones exactas (ej. 1280x720 para thumbnail de YouTube).
qualityNolow | medium (default) | high. xhigh/max solo en gpt-image-2.5-*. Recomendado high para la imagen maestra del Tema.
backgroundNoFondo. transparent requiere output_format png o webp.
overlay_textNoTexto compuesto con las fuentes reales de marca (no generado por la IA). Se aplica DESPUÉS de crop_to, así que las coordenadas son sobre la imagen final.
output_formatNoFormato del archivo final. Default png.
incluir_base64NoDefault false. Si true, agrega file_name + file_base64 (compatible con upload_file_base64 de Pipefy). Ojo: una imagen en base64 pesa millones de caracteres y puede truncarse o llenar el contexto; lo recomendado es upload_file_path con el file_path devuelto.
nombre_archivoNoPrefijo para el nombre del archivo (ej. 'tema-123-linkedin'). Default: primeras palabras del prompt.
incluir_previewNoDefault true. Devuelve una miniatura (512px) para revisar el resultado visualmente.
output_compressionNoCalidad 0-100 para jpeg/webp.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, openWorldHint=true) by disclosing concrete side effects (saves file to disk), the return contract (file_path), and the failure contract (explicit tipo_error, código, mensaje; never an empty image). This is genuinely useful behavioral context.

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?

Three dense, front-loaded sentences with no filler. Core purpose comes first, followed by side effect/return value and error behavior. Every sentence earns its place.

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 complex 13-parameter tool with no output schema, the description covers the primary return path and error behavior, while the rich schema descriptions cover parameter-level details. It could be more explicit about multi-image responses when n>1 or optional base64/preview fields, but it is substantially complete.

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 baseline is 3. The description does not add significant per-parameter meaning beyond the schema; 'prompt en inglés' repeats schema info, and file_path/error details describe output, not parameters.

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?

States a specific action ('Genera una imagen desde cero'), resource ('API de OpenAI'), and outcome (guarda el archivo y devuelve file_path). The phrase 'desde cero' distinguishes it from sibling tools like generar_variacion and componer_imagen.

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?

Provides some context ('para adjuntarla a Pipefy con upload_file_path') but never explicitly says when to use this tool vs alternatives like generar_variacion, componer_imagen, or listar_modelos_imagen. Usage is implied rather than clearly stated.

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