Skip to main content
Glama

Generate an image

generate_image

Generate one image from a prompt after quoting credits; poll get_run for delivery. Failed generations cost nothing, and identical requests reuse the existing run unless you pass attempt 2.

Instructions

Input: the same fields as quote_image, plus attempt. Generate one image from a prompt, a NEW run, charged the quoted credits once delivered; its run_id can be a later reference. Poll get_run. A generation that fails is charged nothing. Repeating an identical request returns the run it started, starting nothing new; pass attempt 2 for another one. Price: 5 to 38 credits per image, by model and size. Quote first with quote_image.

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>",
      "model": "<model>",
      "aspect_ratio": "<aspect_ratio>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYes
promptYes
attemptNo
keep_textNo
referencesNo
max_creditsNo
aspect_ratioYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.73.0
    • addedInput schema / properties / attempt / minimum
      Added value: +1
  2. Changed1 schema field changedv0.61.0
    • addedInput schema / properties / max_credits
      Added value: +{
      +  "type": "integer"
      +}
  3. Changed1 schema field changedv0.56.0
    • addedInput schema / properties / keep_text
      Added value: +{
      +  "type": "boolean"
      +}
  4. Changed11 schema fields changedv0.39.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / aspect_ratio / enum
      Removed value: -[
      -  "9:16",
      -  "16:9",
      -  "1:1"
      -]
    • removedInput schema / properties / attempt / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / attempt / minimum
      Removed value: -1
    • removedInput schema / properties / model / enum
      Removed value: -[
      -  "seedream-5.0-flash",
      -  "flare"
      -]
    • removedInput schema / properties / prompt / maxLength
      Removed value: -2000
    • removedInput schema / properties / prompt / minLength
      Removed value: -1
    • removedInput schema / properties / references / items / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "rights_confirmed": {
      -        "const": true,
      -        "type": "boolean"
      -      },
      -      "upload_id": {
      -        "pattern": "^upl_[a-f0-9]{32}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "upload_id",
      -      "rights_confirmed"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "run_id": {
      -        "pattern": "^run_[a-zA-Z0-9]+$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "run_id"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "asset_id": {
      -        "pattern": "^ast_[a-f0-9]{32}$",
      -        "type": "string"
      -      },
      -      "rights_confirmed": {
      -        "const": true,
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "asset_id"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / references / items / type
      Added value: +"object"
    • removedInput schema / properties / references / maxItems
      Removed value: -4
  5. Addedv0.33.0

TDQS

A4.2/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing billing semantics (charged once delivered, failures cost nothing), a concrete price band (5-38 credits by model and size), idempotent deduplication of identical requests, and the fact that the returned run_id is reusable. The one gap is the relationship between max_credits and the quoted price, which is never explained.

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?

Dense and front-loaded: the billing and dedupe rules come before the polling instruction, and no sentence is filler. The opening 'Input: the same fields as quote_image, plus attempt' is slightly awkward phrasing but does real routing work.

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, non-read-only tool with no output schema, the description covers the critical unknowns: cost, when charges land, failure billing, idempotency, and how to retrieve results. The residual gap is the semantics of three optional parameters that materially affect the request.

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

Parameters2/5

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

Schema description coverage is 0% across 7 parameters, so the description must carry the load. It explains only 'attempt' (bump to 2 to force a new run) and hints that model and aspect_ratio drive price, while keep_text, references, and max_credits are left completely undefined and the rest are deferred to 'the same fields as quote_image'.

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 from a prompt') and immediately qualifies it as 'a NEW run' that is charged, which separates it from quote_image (pricing) and get_run (polling). An agent can pick this tool without opening any schema.

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?

Gives an explicit ordered workflow: 'Quote first with quote_image' before calling, then 'Poll get_run' after. It also names the retry path ('pass attempt 2 for another one') for the case where an identical request would otherwise be deduplicated.

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