Skip to main content
Glama

Generate image → return bytes

generate_image_bytes

Generate an image with OpenAI and return it inline as base64 so it appears directly in the conversation without saving a file; best for small previews/icons.

Instructions

Generate an image with OpenAI and RETURN it inline as a base64 image block (no file is written). The image is viewable directly in the conversation. Note: large/full-res images are heavy to pass this way — best for small previews/icons. To persist a returned image, the assistant should re-save it.

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_bytes"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoImage size. Square / landscape / portrait / auto. Default: auto.
promptYesWhat to draw. Be specific about style, colors, composition.
qualityNoRender quality (higher costs more). Default: auto.
backgroundNoUse "transparent" for logos/icons (PNG/WebP only). Default: auto.
output_formatNoFile format. Default: png.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and does well: it discloses that nothing is written to disk, that the payload is heavy for large images, and that persistence requires a separate re-save step. It omits any mention of cost or latency implications of generating images, but the core side-effect profile (no disk write, inline payload) is explicit.

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 the return-mode, which is the decisive fact, and the caveat plus persistence note follow in a logical order. There is mild redundancy between "RETURN it inline as a base64 image block" and "viewable directly in the conversation", but no sentence is wasted.

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

Completeness5/5

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

There is no output schema, so the description takes on the job of explaining the return value and does so precisely: an inline base64 image block, viewable in conversation, with a size caveat. Combined with a fully documented five-parameter schema, nothing an agent needs in order to call it correctly is missing.

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% and every parameter has a documented enum with defaults and meaning (including the logo/icon guidance for transparent), so the schema does the heavy lifting. The description adds no parameter-level detail beyond what is already structured, which is the expected baseline here.

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 verb and resource (generate an image with OpenAI) plus the defining output mode: returned inline as a base64 image block with no file written. That output-mode clause is exactly what separates it from a file-persisting sibling, so an agent can select it without opening the schema.

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?

Gives clear context for use: "best for small previews/icons" steers away from large/full-res work, and "To persist a returned image, the assistant should re-save it" defines the follow-up path. It stops short of naming the alternative tool explicitly, so the agent must infer that a file-writing variant exists.

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