Skip to main content
Glama

Text To Image Price

text_to_image_price

Calculate the exact cost of a text-to-image generation job before running it. Pass the same parameters the job will use, including quality, so the quote matches the actual charge.

Instructions

Calculate price for text-to-image generation.

Pass the same parameters the generation call will use. Fields that affect the charge — quality above all — change the quote, so omitting them here produces a number the job will not honour.

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>"
    },
    "name": "text_to_image_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoRandom seed the job will use
lorasNoLoRA adapters the job will use: [{'name': str, 'weight': float}]
modelYesAI model name
stepsNoNumber of diffusion steps. Limits per model (see the model list)
widthNoImage width in pixels. Limits per model (see the model list)
heightNoImage height in pixels. Limits per model (see the model list)
promptYesText description for price calculation
qualityNoQuality tier, e.g. 'low', 'medium', 'high'. On gpt-image-1.5 the tiers differ ~14x in price, so quoting without it can be badly wrong
guidance_scaleNoGuidance the job will use. Defaults to the model's own value; limits per model (see the model list)
negative_promptNoThings to exclude — quote it if the job will use it

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.3

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose the key behavioral trait: the quote is only valid if parameters match the eventual job, and quality can swing price ~14x. It does not mention cost of the call itself, rate limits, or caching, so it is strong but not exhaustive.

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?

Two short sentences, front-loaded with the purpose, then the critical caveat. No filler; the em-dash aside on quality is the only slightly ornate element.

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?

An output schema exists so return values needn't be explained, and the schema fully covers parameters. The description supplies the one non-obvious operational rule (match the generation call's parameters), leaving only minor gaps like whether the quote is free or time-sensitive.

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%, so the schema already documents all ten parameters including the quality tier warning. The description reinforces that quality and other charge-affecting fields matter but adds no syntax or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Calculate price for text-to-image generation.' The 'price' framing plus the instruction to pass the same parameters the generation call will use makes it distinguishable from the generation sibling, though it never names that sibling explicitly.

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 usage context: call it with the exact parameters the generation job will use, and warns that omitting charge-affecting fields yields a quote the job won't honour. It stops short of explicitly saying 'call this before text_to_image' or naming alternatives, so it is clear context without full when/when-not routing.

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