Skip to main content
Glama

Generate Hero Image

post_posts_by_id_hero

Generate (or regenerate) a blog post's hero image, or its OG social card — works the same before and after the post exists. Returns the image inline plus its public URL. The fields below cover prompts, references, style, and the commit:false review flow. Rules that span fields: only the title and subtitle may ever appear on an OG card, because given anything else the generator invents its own tagline; an OG card takes NO references unless you name them, since auto-matching used to put a real face on social cards nobody asked to be in; for target:"og" prompt is the VISUAL DIRECTION and still gets OG framing; to anchor a face, mark the photo as a "headshot" via mark_reference_image first.

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": {
      "id": "<id>"
    },
    "name": "post_posts_by_id_hero"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesPost UUID
agentNoYour name, on every write: Duet/<channel name> or Grok Bot/<bot name>.
styleNoVisual style. Defaults to "modern".
commitNoDefault true: apply the image to the post immediately. False generates a review CANDIDATE (kind hero-candidate) and leaves the post untouched.
domainNo
promptNoImage prompt, auto-generated from the post if omitted. For target:"og", layered on the site share_card_style.
targetNo"hero" (default) sets featured_image; "og" makes the 1200x630 Open Graph card and sets og_image, leaving the hero untouched.
site_idNo
alt_textNoACCEPT mode: override the auto-generated alt text on the accepted asset. Applies to accept_asset_id; ignored on accept_image_url.
subtitleNoOG only. Secondary line rendered verbatim beneath the title. Defaults to the post's own subtitle; nothing appears unless passed or stored.
caller_nameNoOptional self-reported label for who/what is generating (e.g. an agent name). Shows up in get_hero_history as caller_name — a label you provide, not a verified identity. Omit to default to your account id.
accept_asset_idNoACCEPT mode, no generation: promote a candidate and attach it. Sets og_image for an OG candidate (og-candidate kind), or featured_image + hero_asset_id for a hero candidate. The field_set key in the response says which field was written.
accept_image_urlNoACCEPT fallback when only the URL is known — sets featured_image (or og_image when target: "og" is also passed) without asset promotion.
include_subtitleNoOG only. Default true. False renders a title-only card even when the post has a subtitle.
iteration_promptNoEdit instruction for iterating on a previous hero (e.g. "make the background darker"). Requires source_image_url, which anchors composition.
latest_candidateNoREAD mode, no generation: returns the newest un-accepted hero candidate for the post.
source_image_urlNoURL of the hero to iterate on (a prior result's image_url). Used with iteration_prompt.
include_title_textNoOG only. Default true: render the title as text on the card. False produces a purely visual card.
reference_image_idsNoCurated reference IDs and/or media-library asset IDs (upload_media / list_media). Omitted: reuses the first hero's references, else auto-matches from the prompt. [] uses none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/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 load and mostly succeeds: it discloses the return value ('the image inline plus its public URL'), that commit:false leaves the post untouched and creates a hero-candidate, and which field each target writes. The cross-field rules (only title/subtitle may appear on an OG card; OG takes no references unless explicitly named) reveal non-obvious side effects an agent could not infer. Gaps remain on permissions, cost/latency of generation, and failure behavior.

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 purpose and return shape, then a pointer to the field-level detail, then the cross-field rules — good ordering for a large tool. The rules block is slightly rambling ('auto-matching used to put a real face on social cards nobody asked to be in'), but that backstory does justify a rule the agent might otherwise override, so it mostly earns its space.

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 19-parameter, no-output-schema generation tool, the description covers the return value, the pre/post-existence scope, and the review-and-accept lifecycle well enough to call it correctly. What is missing is operational: no note on whether generation is slow or costly, what happens when prompt auto-generation fails, or whether concurrent candidates conflict.

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 already 89%, so the baseline is 3, and the description clears that bar by adding cross-parameter semantics the schema does not state: prompt is a VISUAL DIRECTION when target:"og" and is layered on the site share_card_style, references auto-match unless omitted or emptied with [], and alt_text applies only to accept_asset_id and is ignored on accept_image_url. These are exactly the interactions a 19-parameter tool needs spelled out.

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?

Opens with a specific verb + resource ('Generate (or regenerate) a blog post's hero image, or its OG social card') and immediately distinguishes the two output types, which the opaque tool name post_posts_by_id_hero does not. The 'works the same before and after the post exists' clause also tells the agent it is not gated on publishing state.

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?

Explicitly routes among the tool's own modes: commit:false for a review candidate, accept_asset_id/accept_image_url for promotion without generation, latest_candidate for read-only lookup, and iteration_prompt + source_image_url for iterating on a prior hero. It also names a cross-tool prerequisite ('mark the photo as a "headshot" via mark_reference_image first'). It does not name sibling alternatives such as upload_media for pre-existing images, so not a 5.

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.