Skip to main content
Glama

Generate an image inside an ebook

generate_content_image

Generate one image with AI and place it INSIDE one of the caller's ebooks, either filling an existing image placeholder (blockId) or inserting a new image after a block (afterBlockId). With no prompt the subject is taken from the heading and paragraph around that spot, so writing the content first produces images that fit it. Choose WHERE an image belongs; Unplain decides its shape and how large it is drawn from the space on its page, so there is no size to set. WHEN TO USE IT: generate an image where it materially improves comprehension or visual rhythm, for example to show a physical thing, explain a process, set atmosphere at the start of a part, or break up a long dense stretch. Do NOT put one after every section; an ebook reads as edited when its images are chosen, and as padding when they are automatic. A twenty page guide usually wants a handful, not twenty. NEVER use an image to present data. An image model invents the numbers as well as the bars, which produces a plausible fabricated statistic inside a document a reader will trust. For a statistical passage choose a conceptual or diagram style that carries the idea without figures. To explain a process, comparison or set of relationships choose the infographic style: it draws one structure from the surrounding section, wordless, so put its words in the caption. The artwork is always wordless: the no-text rule cannot be lifted by a prompt, and captions are real text set by Unplain, passed as the caption argument. This spends the SAME shared AI image allowance as generating a cover or generating one in the Unplain web app (get_account reports it); MCP has no separate allowance, and every plan has one (Free includes a few lifetime images). One image per call, a failed generation costs nothing, and the image is attached to the ebook rather than returned.

Input Schema

NameRequiredDescriptionDefault
altNoAlt text for accessibility. Worth setting on every image.
styleNoMedium and mood. LEAVE IT UNSET when the ebook already has generated images: the new one is then matched to the first one automatically, using it as a visual reference, which is how a set of images ends up looking like one publication. Naming a style overrides that and is the right call only when you deliberately want this image to differ. Pick 'diagram' for a schematic, 'infographic' to explain a process, comparison, hierarchy or set of relationships from the surrounding section as one editorial figure, and 'conceptual' for an idea rather than a thing. An infographic is drawn WORDLESS (the model writes labels and figures unreliably, so none are drawn): pass the words that go with it as the caption, and let the section text supply the content. Do NOT use an image to present data: charts are drawn with invented numbers and are never acceptable in a document a reader will trust.
promptNoWhat the image should show, as imagery: subject, setting, mood. Omit it and the subject is derived from the heading and paragraph around the insertion point, which is usually enough. The image is generated with a hard no-text rule that no prompt can lift, so do not ask for labels, captions or any writing in the picture.
blockIdNoFill an image placeholder that already exists, keeping its position, caption and alignment. Use read_ebook to find placeholders that have no image yet. Give either this or afterBlockId, never both.
captionNoCaption printed under the image. Also the strongest steer on what to generate, since it states what the picture is meant to show.
projectIdYes
afterBlockIdNoInsert a new image directly after this block. Use the id of the paragraph the image should follow; given an image, the new one goes after that image's caption. Give either this or blockId, never both.
replaceExistingNoRequired to overwrite an image the block already has. Left false, a call against a filled block fails without spending an AI image allowance, which makes an accidental retry safe.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing that generation draws on a shared AI image allowance across covers and the web app, that a failed generation costs nothing, that it is one image per call, and that the image is attached to the ebook rather than returned. It also explains that size and shape are decided server-side and that the wordless rule cannot be overridden, removing the need to experiment. The annotations already cover the mutation/idempotency profile, so the remaining gap is small.

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-loads the action and placement mode, then moves into WHEN TO USE and prohibitions, which mirrors how an agent reads it. It is on the long side and repeats the data-visualization ban and the wordless rule in both the description and the schema, which is some duplication rather than wasted effort.

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?

No output schema exists, and the description compensates by stating that the image is attached rather than returned, that it is one image per call, and what a failed call costs. For an 8-parameter mutation tool with no output schema, an agent has everything needed to call it correctly.

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 coverage is 88%, so the schema already carries most parameter meaning, but the description adds a few genuinely useful points: there is no size parameter to worry about, style should be left unset so new images match existing ones, and caption doubles as the strongest steer on generation. It also explains that replaceExisting=false failure is free, which makes the retry-safe semantics concrete.

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 one image with AI, placed inside one of the caller's ebooks) plus the two placement modes (fill a placeholder via blockId or insert after a block via afterBlockId). It clearly distinguishes itself from the sibling cover generator by scope: this operates inside ebook content, not on the cover.

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 criteria (physical thing, process, atmosphere, breaking up dense text) and explicit when-not rules (not after every section, never for presenting data, with a stated frequency heuristic of a handful per twenty pages). It also routes style choice, telling the caller to use infographic for processes/comparisons and conceptual for ideas.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources