Skip to main content
Glama

generate_image

Creates an OpenAI image from a text prompt and saves it to disk, returning the file path. Set quality, size, and background for drafts, hero banners, or transparent logos.

Instructions

Generate an image with OpenAI and save it to disk. Returns the saved file path.

QUALITY - choose carefully, higher quality costs much more:

  • "low" (default) drafts, previews, trying out ideas, placeholders.

  • "medium" decent images for normal use when low looks too rough.

  • "high" ONLY for final assets the user explicitly wants in high quality, or after a low-quality draft has been approved. Never use "high" for experiments or multiple variations.

size: 1024x1024 square, 1536x1024 landscape (hero banners), 1024x1536 portrait. background: "transparent" for logos/icons/stickers (needs png or webp). output_path: where to save, ideally an absolute path inside the user's project, e.g. "/Users/me/site/images/hero.png" or "C:\Users\me\site\hero.png". ~ and environment variables are expanded. A folder gets an auto-named file; a relative path is saved inside the default folder. If omitted, saves to the user's Pictures folder. model: override the default model (normally leave empty).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNo1024x1024
modelNo
promptYes
qualityNolow
backgroundNoauto
output_pathNo
output_formatNopng

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the disk-write side effect and return value, cost implications ('higher quality costs much more'), path expansion of '~' and environment variables, auto-naming for folder paths, relative-path fallback, default Pictures folder, and the transparency constraint that background requires png or webp. It does not mention the output_format parameter or error/failure behavior, which keeps it short of a 5.

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?

Front-loaded with a one-line summary, then organized into labeled parameter blocks with aligned examples, so it scans well. The quality block is somewhat verbose with repeated warnings about 'high', but that repetition serves a cost-control purpose rather than being filler.

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 7-parameter generation tool with an output schema and no annotations, this is nearly complete: side effects, cost tradeoffs, path resolution, and default behaviors are all spelled out, and return values are covered by the output schema. The single notable omission is any explanation of output_format and how it pairs with the png/webp requirement for transparency.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it largely does: quality gets detailed per-value semantics, size gets use-case hints, background gets a format prerequisite, output_path gets path-resolution rules and examples, model gets a terse 'override the default model'. The gap is output_format, which is never mentioned even though it interacts with the background constraint.

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 first sentence gives a specific verb and resource ('Generate an image with OpenAI') plus the side effect ('save it to disk') and the return value ('saved file path'). There are no sibling tools to distinguish from, so this is as precise as the purpose statement can be.

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

Usage Guidelines5/5

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

Provides explicit when-to-use and when-not-to-use guidance for the quality enum ('low' for drafts/placeholders, 'high' ONLY for final assets or approved drafts, 'Never use high for experiments or multiple variations). Size and background values also carry situational hints ('hero banners', 'logos/icons/stickers').

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

Deploy Server

Other Tools