Skip to main content
Glama

Generate media

run

Run any generation model by name with a params object. Returns a job_ref; poll get_job until completed for the output URL (or result_text for transcription). File-input params (see list_models file_inputs) take an upl_ ref (from POST /api/upload, or the upload_from_url / upload_file tools), the job_ref of an earlier completed job to chain its result into this one, or a hosted URL; transcription/speech-to-text models and models priced by their input's length or size require a ref so the input can be measured. The price depends on the model and params and is charged in whole app credits ($0.10 each): cost_credits in the reply is what is reserved, cost_micros/cost_usd the same amount in usd_micros and USD. The credits are RESERVED when the run is submitted and released again if it fails or is rejected; only a completed run is charged, so a failed generation costs nothing and needs no refund; if your credits do not cover it, buy credits in the app.

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": {
      "model": "<model>"
    },
    "name": "run"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesthe model name from list_models (e.g. flux-2, kling-video-text)
paramsNoparameters for the model as an object, e.g. {"prompt":"a cat","num_images":2}. Call list_models to see each model's params and defaults.
idempotency_keyNooptional caller-chosen id (any unique string) that makes a retry safe - repeating it returns the original job instead of running and billing again. Use one whenever a network error leaves you unsure whether the run started.

Output Schema

NameRequiredDescriptionDefault
notesNo
statusYes
job_refYes
messageYes
cost_usdNo
agent_tokenNo
cost_microsNo
cost_creditsNo
agent_token_noteNo

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.5/5.0
Behavior5/5

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

The annotations only declare the generic safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=false), leaving billing and lifecycle undescribed, and the description fills exactly that gap: credits are reserved on submit and released if the run fails or is rejected, only completed runs are charged, cost_credits/cost_micros/cost_usd are returned, and credits must be topped up in the app. The idempotency_key semantics are also spelled out in the schema, so a caller knows an empty idempotentHint does not prevent safe retries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and return contract are front-loaded in the first sentence, which is good, but the file-input sentence is a single run-on with nested parentheticals and alternatives ('an upl_ ref (from POST /api/upload, or the upload_from_url / upload_file tools), the job_ref of an earlier completed job..., or a hosted URL') that is harder to parse than it needs to be. The pricing paragraph repeats reservation/release facts several ways.

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?

For a submit-and-poll generation tool with a nested free-form params object and an output schema, this covers everything an agent needs: how to discover model params, how to supply file inputs, what comes back (job_ref, cost fields), when to poll, and the failure-cost model. Nothing material is missing.

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 100%, so the baseline is 3, but the description adds real meaning beyond it: file-input params (per list_models file_inputs) accept an upl_ ref, the job_ref of a prior completed job for chaining, or a hosted URL, and transcription/length-priced models require a ref so input can be measured. That is constraint knowledge the schema does not carry.

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?

The description states a specific verb and resource ('Run any generation model by name with a params object') and immediately fixes the scope: it submits a job and returns a job_ref, distinguishing it from get_job (which polls) and list_models (which supplies model names and params). An agent can pick it out from the siblings 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear operational context: call list_models for model names and params, then poll get_job until completed for the output URL or result_text, and obtain upl_ refs from POST /api/upload or the upload_from_url / upload_file tools. It does not state any when-not-to-use case or explicitly rule out the sibling tools, so it falls short of 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.

Resources