Skip to main content
Glama

Create a Yorai job

yorai_create_job

Start an image, video, or audio generation job with a credit quote that refuses if the cost exceeds max_credits, and retry with the same idempotency key to avoid double charges.

Instructions

Start an image/video/audio generation. SPENDS CREDITS. The server quotes first and refuses if the hold exceeds max_credits. Returns the job; then poll yorai_get_job. Pass the same idempotency_key when retrying an ambiguous failure so you are not charged twice.

Input Schema

NameRequiredDescriptionDefault
typeNoGeneration type, e.g. text-to-image, image-to-video. Optional only if the model has one type.
inputYesModel inputs. Use exact names/values from yorai_get_model. File inputs take file IDs from yorai_upload_file.
modelYesModel slug, e.g. bytedance-seedance-2-5, z-image, nano-banana-2-lite
max_creditsYesRefuse if the quoted hold (upTo) is above this. Use the amount the user approved.
webhook_urlNo
idempotency_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Discloses traits the annotations cannot express: the call spends credits, the server quotes a hold first and refuses if it exceeds max_credits, and the response is a job handle requiring polling. The idempotency_key retry instruction is consistent with (and explains) idempotentHint=false, since repeat calls do create new charges unless a key is reused.

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

Conciseness5/5

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

Four sentences, front-loaded with the cost warning in caps, then the guardrail, return shape, and retry rule. No filler; each sentence changes agent behavior.

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, yet the description says it returns the job and points to yorai_get_job for results. The nested input object is correctly deferred to yorai_get_model and yorai_upload_file, covering everything needed to invoke it safely.

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 67%; the description adds the key semantic the schema lacks — purpose and retry behavior of idempotency_key — and clarifies the max_credits guardrail beyond its schema text. webhook_url remains unexplained in both places, leaving one gap.

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 ("Start an image/video/audio generation") and immediately signals the financial side effect with "SPENDS CREDITS." It is distinguishable from listing/reading siblings and names yorai_get_job as the follow-up step.

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 workflow context: call this to start generation, then poll yorai_get_job, and reuse idempotency_key on ambiguous retries. It stops short of explicitly contrasting with yorai_quote for cost pre-checking, so the alternative-path guidance is implied rather than stated.

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