# create_game_asset

Check discovery first: this tool is served only where it is enabled and priced. It turns a
description of one character or four-legged animal into a rigged, animated `model.glb` in one job
with one charge: a picture of it in a neutral pose, a textured model rebuilt at your triangle
budget with new textures, a skeleton and skin, and a standard set of clips. It takes no file:
`input.kind` is `parameters`.

The body is found from the rigged model (or set with `body`):

- humanoids (two legs, two arms and a head): `idle`, `walk`, `run`, `jump`, `attack`, `hit`, `wave`,
  `death`; bones carry Mixamo names (`mixamorig:Hips`…);
- four-legged animals: `idle`, `walk`, `run`, `jump`, `attack`, `death`.

`idle`, `walk` and `run` loop. Other bodies (props, vehicles, birds, winged creatures) fail and are
refunded.

Options: `description` (required, up to 4000 characters: one character or animal and its look;
leave the pose out, the job asks for a full body in a neutral pose), `target_faces` (1000–100000
triangles in the finished model, default 20000), `texture_resolution` (1024 or 2048, default 2048),
`body` (`auto`, default, `humanoid` or `four_legged`: set it when auto finds the wrong one),
`in_place` (default true: clips stay on the spot; false keeps the forward travel of walk and run),
optional `seed` (0–4294967295; another seed gives another character). Keep the description out of
URLs: send it in the JSON body or as MCP arguments. `idempotency_key` is **required**: repeating the
same request with the same key returns the same job instead of paying again.

The job is accepted asynchronously with a two-hour deadline from creation, including queueing and
execution; it usually takes several minutes, longer when workers start cold. `wait_seconds` is at
most 45, so poll `get_job` with `wait_seconds: 45` until the status is final; the job reports
`workflow.stage` and `workflow.deadline`. Do not start the job again while it runs. While the job
advertises `capabilities.can_cancel`, `cancel_job` cancels and refunds it.

Outputs:

- `model.glb`: the finished character, one textured mesh, its skeleton and skin, every clip as a
  named animation at 30 frames per second. Uncompressed, textures embedded.
- `reference.png`: the picture the model was built from (transparent background).
- `rig.json`, `rig_report.json`, `rig_preview.png`: the skeleton, its checks and bend tests, and a
  picture of both (see [rig_3d_model.md](rig_3d_model.md)).
- `motion.json`: the body and, per clip, its frames, duration, facing, travel, bone roles and foot
  contacts.
- `motion_report.json`: each clip's checks (`foot_slide`, `foot_float`, `floor`, `pop`, `jitter`,
  `loop_seam`) and its status (see [animate_3d_model.md](animate_3d_model.md)).
- `motion_preview.png`: five moments of every clip, one row per clip.
- `generation.json`: options without the description; for each step its image digest, model revision,
  files, summary and timings.

The job's `result` carries `body`, `faces`, `bone_count`, `clips` (each clip's `name` and `status`),
`status` and the first five `issues` of the rig and the clips.

**A succeeded job means the character was made, not that it looks right.** `status` is the worst of
the rig's and the clips' (`passed`, `needs_review`, `failed_checks`). A rig flagged `failed_checks`
(stretched or torn skin in its bend tests) can show in wide motions even when every clip passes. Before
using the character, look at `motion_preview.png` and `rig_preview.png` and tell the user what the
reports say; another `seed` or a plainer description may do better, and each job is charged.

For another motion, pass `model.glb` to `animate_3d_model` as `job_file` with `keep_animations: true`
and a `clip_name`: the new clip joins the others in the same file.

Price: read `pricing` in `GET /v1/tools` before starting the job. The charge is made before
generation starts; a job that fails or is canceled is refunded.

Without MCP:

```bash
curl https://api.mcpbytes.com/v1/tools/create_game_asset/jobs \
  -H "Authorization: Bearer $MCPBYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"options": {"description": "a small green goblin in a leather tunic"},
       "idempotency_key": "my-goblin"}'
```

Or with the bundled client: write the options to a JSON file and run
`python scripts/mcpbytes.py run create_game_asset --options-json options.json --out goblin/`.

Handle `inference_failed` (no humanoid or four-legged skeleton in three tries: a prop, vehicle or
winged creature, or a character drawn holding things; describe one full body, or try another seed),
`unsupported_rig`, `invalid_image`, `invalid_output`, `timeout` and `capacity_exhausted` (budget
exhausted at creation, HTTP 503, or before charging a queued job). A failed job is refunded. Do not
repeat a failed request unchanged.
