Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: agents can generate wardrobe garments via MCP

nirholas96b5daf9d229
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14c5d01ab..de1cb20cb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Closed the tab while your avatar was building? It finishes anyway now** — Until today, a selfie avatar only completed while you kept the page open: your browser did the checking, and if you closed the tab after uploading, the engine finished your avatar but nobody ever came back to collect it. The job sat unfinished forever and your library never received the result. We found jobs stranded this way going back a month. The platform now checks in on every in-flight avatar itself, every few minutes, and files the finished result into your library exactly as if you had waited, so starting an avatar on your phone and pocketing it mid-build is now fine. The same pass also went back through every stranded job from the past month and delivered the ones whose results were still recoverable. Separately, the selfie page no longer shows a Masc and Femme body choice. Honest reason: the engine builds every avatar on one shared template body today, so that toggle changed nothing and never had, which is worse than not offering it. A real body choice, with sliders for build, height and more rather than two buttons, is planned on the parametric avatar base. (`/create/selfie`) `[fix, improvement]`
- **Crypto API: automatic upstream failover ends most rate-limit errors** — The unified crypto API (/api/v1/x) no longer fails your call just because one upstream host had a bad moment. When a provider is backed by a pool of interchangeable hosts (the Solana read endpoints front the platform's full RPC pool), a rate-limited, unreachable, or erroring host now fails over to a healthy alternate within the same request. The API also remembers which host just failed for a short window, so during an outage only the first request pays the discovery cost and everything after routes straight to a working host. Rate-limit passthrough was the second-largest error class on the aggregator; this removes it for pooled providers. (`/crypto-api`) `[improvement, infra]`
- **Dress any avatar: the wardrobe now adds clothes, not just recolours them** — Until now the wardrobe could only recolour or hide the clothes an avatar was generated with. It can now put NEW clothes on: the avatar editor's Wardrobe tab gained a Closet with racks of catalog pieces (tops, bottoms, footwear, outerwear, hair, headwear, glasses, accessories). Click a piece and it binds to your avatar's skeleton and moves with every animation, whatever generator the avatar came from: forge characters, selfie reconstructions and uploaded models all work, because garments are fitted to the skeleton at wear-time instead of being authored for one specific body. The body is masked under whatever you wear so skin never pokes through the cloth, a piece that cannot fit a particular skeleton politely refuses instead of deforming into spaghetti, and every download is integrity-checked against the catalog before it touches your avatar. Saved outfits persist: the downloadable and embedded versions of your avatar come out dressed too. (`/avatar-edit`) `[feature]`
+- **Garment generation is now open to everyone: API and agent tools** — The garment generator that fills the wardrobe catalog is now a public surface. Developers can create wearables with one HTTP call (POST /api/garment-forge with a description and a slot, then poll the job), and AI agents get the same power through three new MCP tools: generate_garment, garment_status, and list_garment_catalog. Every generated piece is validated end to end before it publishes, appears in the shared catalog immediately, and fits any humanoid avatar. The catalog now covers tops, jeans, sneakers, and a leather jacket, with more slots filling in. `[feature, sdk]`
- **Our crypto API no longer reports itself as broken to the directories that rate it** — Agent directories and uptime monitors discover an x402 API by calling every endpoint it advertises with no arguments, to check the endpoint is alive and knows its own price. Our paid-only endpoints answered that correctly with a payment challenge, but the free-tier ones ran argument validation first and answered with an error, so about two dozen perfectly healthy endpoints were being graded as failing by a public trust monitor, roughly 14,000 times a month. A parameterless call now returns the standard 402 challenge on every endpoint, with the argument you would need named in an X-Param-Error header. Nothing changes for real callers: send any argument, even an empty one, and you get the specific validation error as before. The same probes were also the single biggest source of noise in our own error metrics, so a genuine outage in the crypto API is now visible instead of buried. (`/crypto-api`) `[fix, improvement]`
- **Our x402 facilitator now publishes a standard discovery catalog** — The three.ws self-hosted x402 facilitator serves a new public endpoint, GET /api/x402-facilitator/discovery/resources, listing every paid endpoint on the platform in the standard facilitator catalog format that x402 explorers and aggregators (like x402scan) crawl. It is the same catalog as /.well-known/x402.json, so listings on third-party explorers always match what the platform actually charges. This is groundwork for three.ws payments showing up on ecosystem explorers without routing settlement through any third party. (`/docs/x402-ring-economy`) `[feature, infra]`
- **Selfie avatars now match the shape of your face, not just the colour of it** — The selfie-to-avatar engine used to do one thing: take the face from your photo and paint it onto a standard head. From straight on it looked convincing, but the skull underneath was the same for everyone, so the moment the avatar turned it stopped being you. It now reshapes the head itself to your face: width, jaw, chin, cheekbones, brow, and how far the nose projects. That step had been written and tested for a while but had never actually reached the servers, so every avatar made until today was built the old way. Making it live also turned up a flaw in how the photo was read. Face measurements arrived scaled to the picture's width and height separately, which means a tall photo stretched the face before anything else happened, and that stretch was then treated as part of your bone structure. In practice the shape of your avatar's head partly depended on whether you shot the photo tall or square, which is not something anyone would expect. Measurements are now taken in true proportions, so the same face gives the same head regardless of how the photo was framed. Finally, the limits controlling how far the head is allowed to move toward your real shape were set before there was any way to measure the result. They were far too cautious, holding the head back to about two centimetres of change and quietly discarding real differences between faces. Measured across a forty-face test set covering a wide range of ages, complexions, beards, glasses and head coverings, retuning them cut the remaining shape error by 46 percent, and no face in the set came out worse. Choosing that limit needed a second measurement, because a test set of clean, well-lit photos will always argue for removing the limit entirely: it contains nothing for the limit to catch. So each test face was also degraded the way real photos are, with camera shake, a turned head, hair across the face, a dim room and a heavily shrunk upload, and checked for whether the same person still came out with the same head. The setting we shipped is the point where matching your face stops improving but sensitivity to photo quality keeps rising. In total, avatars now capture about 60 percent of the difference between a generic head and your real one, up from 26 percent. Rebuild your avatar at /create/selfie to get one made the new way. (`/create/selfie`) `[improvement, fix]`
diff --git a/STRUCTURE.md b/STRUCTURE.md
index bd691d245..f0c35402d 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -80,7 +80,7 @@ bottom.
| Avatar Composer (modular studio generation) | [api/_lib/avatar-composer/](api/_lib/avatar-composer) | In-repo · wired into the studio seed lane | Assembles a rigged, ARKit-expression-ready GLB by mixing skinned parts (hair / top / bottom / footwear / glasses) across the RPM base bodies onto **one shared 67-joint skeleton**, then recolors each part and scales the rig — the Ready-Player-Me / Avaturn "one skeleton, many parts" architecture in pure JS on `@gltf-transform`, no GPU or external service. Replaces the recolor-one-of-five-bodies studio lane so two draws almost never look alike. Borrowed parts keep their own inverse binds but remap onto the identity skeleton; mixing is restricted to a base's rest-pose group so parts always fit. Consumed by [api/cron/avaturn-seed-cron.js](api/cron/avaturn-seed-cron.js) (legacy [studio-avatar.js](api/_lib/studio-avatar.js) recolor is the fallback) and the one-click [api/avatars/surprise.js](api/avatars/surprise.js) endpoint (instant avatar, previewed in [public/gallery/surprise.js](public/gallery/surprise.js)). Docs: [api/_lib/avatar-composer/README.md](api/_lib/avatar-composer/README.md). Tests: [tests/avatar-composer.test.js](tests/avatar-composer.test.js) |
| Auto-rigging worker (Mixamo skeleton + ARKit-52 blendshapes) | [workers/rig/](workers/rig) | Code-complete · deploy pending (asset staging + Cloud Build, see its README) | Make-It-Animatable engine (MIT) predicts the 52-bone Mixamo skeleton + weights; [workers/rig/rig_glb.py](workers/rig/rig_glb.py) grafts them into the original GLB (textures untouched); ICT-FaceKit (MIT) ARKit-52 expression transfer for emotions/lipsync. Contract-compatible replacement for the retired `unirig` service behind `GCP_UNIRIG_URL`; cutover is one env-var update. Canonicalization proof: `rig worker skeleton` cases in [tests/glb-canonicalize.test.js](tests/glb-canonicalize.test.js) |
| Additive wardrobe (dress any avatar from the catalog) | Runtime [src/avatar-garment.js](src/avatar-garment.js) + taxonomy [src/garment-taxonomy.js](src/garment-taxonomy.js) + catalog [src/garment-catalog.js](src/garment-catalog.js) + closet UI [src/garment-closet.js](src/garment-closet.js) (in the `/avatar-edit` Wardrobe tab), bake pass [api/_lib/bake-garments.js](api/_lib/bake-garments.js), contract [specs/GARMENT_MANIFEST.md](specs/GARMENT_MANIFEST.md) | Live in the avatar editor · catalog seeding in progress | The wardrobe's additive half: catalog garments (top/bottom/footwear/outerwear/hair/headwear/glasses/accessory) are skinned onto ANY loaded humanoid at wear-time — skin indices rewritten to the avatar's bone order via [glb-canonicalize](src/glb-canonicalize.js) canonical names, garment inverse-binds kept where skeletons correspond (divergent rest poses reconcile), body culled under declared `occludes` regions so skin never clips through cloth, ≥60% weight-coverage gate refuses unbindable pieces. Saved outfits persist in `appearance.garments` and the server bake re-runs the same rebind on @gltf-transform so exports/embeds are dressed. Catalog: public GCS `three-ws-garments` bucket, sha256-verified per download, licence-gated (CC0/CC-BY/MIT/Apache/BSD only). Docs: [docs/avatar-wardrobe.md](docs/avatar-wardrobe.md). Tests: [tests/avatar-garment.test.js](tests/avatar-garment.test.js), [tests/garment-catalog.test.js](tests/garment-catalog.test.js), [tests/bake-garments.test.js](tests/bake-garments.test.js) |
-| Garment Forge (text prompt → catalog garment) | [workers/garment-forge/](workers/garment-forge), verify harness [scripts/verify-garment.mjs](scripts/verify-garment.mjs), contract [specs/GARMENT_MANIFEST.md](specs/GARMENT_MANIFEST.md) | Live · Cloud Run CPU (`garment-forge`, us-central1) | Generation lane that feeds the additive wardrobe's catalog: prompt → ghost-mannequin reference photo (Vertex image lane) → PBR mesh on the deployed GPU fleet (`model-hunyuan3d-21-rtx` → `model-hunyuan3d-21` → `model-trellis`) → composed onto the canonical reference body (parametric-base) → rigged by `model-rig` with full-body context → reference body stripped back out (pure glTF repack), bones canonicalized, `occludes` derived from REGION_BONES weight mass, all 6 manifest rules validated in-process (including the ≥60% bind-coverage gate) → `garment.glb` + `manifest.json` + `thumb.webp` published immutably to `gs://three-ws-garments/garments/<slot>/<id>/v<n>/` and appended to the live catalog. Build gate: [workers/garment-forge/test_garment_glb.py](workers/garment-forge/test_garment_glb.py) (33 checks, runs inside `docker build`). Docs: [workers/garment-forge/README.md](workers/garment-forge/README.md) |
+| Garment Forge (text prompt → catalog garment) | [workers/garment-forge/](workers/garment-forge), public API [api/garment-forge.js](api/garment-forge.js) `→ POST/GET /api/garment-forge`, MCP tools [api/_mcp/tools/garments.js](api/_mcp/tools/garments.js) (`generate_garment`, `garment_status`, `list_garment_catalog`), verify harness [scripts/verify-garment.mjs](scripts/verify-garment.mjs), contract [specs/GARMENT_MANIFEST.md](specs/GARMENT_MANIFEST.md) | Live · Cloud Run CPU (`garment-forge`, us-central1) | Generation lane that feeds the additive wardrobe's catalog: prompt → ghost-mannequin reference photo (Vertex image lane) → PBR mesh on the deployed GPU fleet (`model-hunyuan3d-21-rtx` → `model-hunyuan3d-21` → `model-trellis`) → composed onto the canonical reference body (parametric-base) → rigged by `model-rig` with full-body context → reference body stripped back out (pure glTF repack), bones canonicalized, `occludes` derived from REGION_BONES weight mass, all 6 manifest rules validated in-process (including the ≥60% bind-coverage gate) → `garment.glb` + `manifest.json` + `thumb.webp` published immutably to `gs://three-ws-garments/garments/<slot>/<id>/v<n>/` and appended to the live catalog. Build gate: [workers/garment-forge/test_garment_glb.py](workers/garment-forge/test_garment_glb.py) (33 checks, runs inside `docker build`). Docs: [workers/garment-forge/README.md](workers/garment-forge/README.md) |
| Parametric avatar base (change-everything sliders) | Baker [scripts/build-parametric-base.mjs](scripts/build-parametric-base.mjs) → [public/avatars/parametric-base.glb](public/avatars), CC0 source data [avatar-sources/anny/](avatar-sources/anny), studio wiring [src/avatar-studio.js](src/avatar-studio.js) (`?base=parametric`) + [src/avatar-sculpt.js](src/avatar-sculpt.js) | Live in Avatar Studio (Base switcher) | One canonical humanoid whose identity is **122 baked morph-target sliders** (nose/ears/mouth/eyes/jaw/cheeks/head shape/neck plus gender, muscle, weight, age, height, torso, hips, limbs), built from the CC0 MakeHuman/MPFB2 body vendored via [naver/anny](https://github.com/naver/anny). 52-bone `mixamorig:*` skeleton, so the full clip library retargets onto every slider combination. Sparse-accessor morphs keep the GLB at ~4 MB. Roadmap to conforming hair/garments + sculpt brush: [prompts/roadmap/avatar-parametric-editor.md](prompts/roadmap/avatar-parametric-editor.md). Tests: [tests/parametric-base.test.js](tests/parametric-base.test.js) |
| Animation gallery | [pages/animations.html](pages/animations.html) + [src/animations-gallery.js](src/animations-gallery.js) | Live at `/animations` | 2,100+ clips with poster thumbnails ([scripts/build-animation-thumbnails.mjs](scripts/build-animation-thumbnails.mjs)), derived categories ([src/animation-categories.js](src/animation-categories.js)), shared live-preview engine ([src/animations-live-preview.js](src/animations-live-preview.js)) · see [docs/animations.md](docs/animations.md) |
| Character Library | [pages/character-library.html](pages/character-library.html) + [src/character-library.js](src/character-library.js) → `/character-library`, API [api/avatars/library.js](api/avatars/library.js) | Live at `/character-library` | 106 professionally rigged Mixamo characters (skinned GLB + thumbnails on R2, `avatars/mixamo/`), each drives the full animation library. Pipeline: [scripts/fetch-mixamo-avatars.mjs](scripts/fetch-mixamo-avatars.mjs) → [scripts/convert-mixamo-avatars.mjs](scripts/convert-mixamo-avatars.mjs) → [scripts/fetch-mixamo-avatar-thumbnails.mjs](scripts/fetch-mixamo-avatar-thumbnails.mjs) → [scripts/build-mixamo-avatar-library.mjs](scripts/build-mixamo-avatar-library.mjs) publishes `avatars/library/manifest.json`. Cards deep-link into the 3D viewer (`/app#model=`), Widget Studio (`/studio?model=`), and Animation Studio (`/pose?src=`). Mirrors the animation-library R2-manifest pattern (no DB). See [public/avatars/mixamo/README.md](public/avatars/mixamo/README.md) |
diff --git a/api/_mcp/catalog.js b/api/_mcp/catalog.js
index ce19cd9a1..c70c989f5 100644
--- a/api/_mcp/catalog.js
+++ b/api/_mcp/catalog.js
@@ -15,6 +15,7 @@ import { toolDefs as oracleDefs } from './tools/oracle.js';
import { toolDefs as traderDefs } from './tools/trader.js';
import { toolDefs as tokenizeDefs } from './tools/tokenize.js';
import { toolDefs as cryptoDataDefs } from './tools/crypto-data.js';
+import { toolDefs as garmentDefs } from './tools/garments.js';
const baseDefs = [
...avatarDefs,
@@ -29,6 +30,7 @@ const baseDefs = [
...traderDefs,
...tokenizeDefs,
...cryptoDataDefs,
+ ...garmentDefs,
];
// Free, public entry point — listed first so discovery clients see it up top.
diff --git a/api/_mcp/tools/garments.js b/api/_mcp/tools/garments.js
new file mode 100644
index 000000000..9865c91c5
--- /dev/null
+++ b/api/_mcp/tools/garments.js
@@ -0,0 +1,222 @@
+// MCP tools for the Garment Forge: agents generate wearable, rigged catalog
+// garments from a text prompt and follow the job to its published manifest.
+//
+// The heavy pipeline runs on the garment-forge Cloud Run worker
+// (workers/garment-forge/README.md): Vertex reference image → GPU mesh fleet
+// → composed onto the canonical body → auto-rigged → validated against the
+// 6 rules of specs/GARMENT_MANIFEST.md → published to the public wardrobe
+// catalog. These tools are the agent-facing face of the same lane the
+// /api/garment-forge HTTP route exposes; the worker's bearer secret stays
+// server-side.
+
+import { limits } from '../../_lib/rate-limit.js';
+
+const GARMENT_SLOTS = [
+ 'top', 'bottom', 'footwear', 'outerwear', 'hair', 'headwear', 'glasses', 'accessory',
+];
+const CATALOG_URL = 'https://storage.googleapis.com/three-ws-garments/garments/catalog.json';
+const JOB_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
+
+function rpcError(code, message, data) {
+ const e = new Error(message);
+ e.code = code;
+ e.data = data;
+ return e;
+}
+
+function workerConfig() {
+ const base = (process.env.GCP_GARMENT_FORGE_URL || '').replace(/\/$/, '');
+ const key = process.env.GCP_RECONSTRUCTION_KEY || '';
+ if (!base || !key) {
+ throw rpcError(
+ -32001,
+ 'garment generation is not configured (GCP_GARMENT_FORGE_URL / GCP_RECONSTRUCTION_KEY unset)',
+ );
+ }
+ return { base, key };
+}
+
+export const toolDefs = [
+ {
+ name: 'generate_garment',
+ title: 'Generate a wearable garment from a text prompt',
+ annotations: {
+ readOnlyHint: false,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ description:
+ 'Turn a text prompt (e.g. "a red varsity jacket") into a rigged, wearable garment ' +
+ 'published to the three.ws wardrobe catalog. The pipeline generates a reference ' +
+ 'image, sculpts a PBR mesh on the GPU fleet, skins it to the canonical humanoid ' +
+ 'skeleton, and validates it (including the 60% bind-coverage gate) before ' +
+ 'publishing garment.glb + manifest.json + thumbnail. Runs asynchronously for ' +
+ 'about 7 minutes; poll with garment_status. The finished piece appears in the ' +
+ 'public catalog automatically and attaches to any humanoid avatar.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ prompt: {
+ type: 'string',
+ minLength: 3,
+ maxLength: 500,
+ description: 'Describe the garment (fabric, color, style).',
+ },
+ slot: {
+ type: 'string',
+ enum: GARMENT_SLOTS,
+ description: 'Wardrobe slot the garment occupies.',
+ },
+ },
+ required: ['prompt', 'slot'],
+ additionalProperties: false,
+ },
+ async handler(args, auth) {
+ const rl = await limits.mcp3dGenerate(auth.userId || auth.rateKey);
+ if (!rl.success) {
+ throw rpcError(-32000, 'rate_limited', {
+ retry_after: Math.ceil((rl.reset - Date.now()) / 1000),
+ });
+ }
+ const { base, key } = workerConfig();
+ const res = await fetch(`${base}/generate`, {
+ method: 'POST',
+ headers: { authorization: `Bearer ${key}`, 'content-type': 'application/json' },
+ body: JSON.stringify({ prompt: args.prompt, slot: args.slot }),
+ }).catch(() => null);
+ if (!res || !res.ok) {
+ throw new Error(`garment worker ${res ? `returned ${res.status}` : 'unreachable'}`);
+ }
+ const job = await res.json();
+ return {
+ content: [{
+ type: 'text',
+ text:
+ `Garment job ${job.job_id} queued (slot: ${args.slot}). The pipeline takes ` +
+ 'about 7 minutes; call garment_status with this job_id to follow ' +
+ 'image → mesh → compose → rig → extract → validate → publish.',
+ }],
+ structuredContent: { job_id: job.job_id, status: job.status || 'queued', eta_seconds: 450 },
+ };
+ },
+ },
+ {
+ name: 'garment_status',
+ title: 'Check a garment generation job',
+ annotations: {
+ readOnlyHint: true,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ description:
+ 'Poll a generate_garment job. While running, reports the pipeline stage. When ' +
+ 'done, returns the published glb_url, manifest_url, thumbnail, measured bind ' +
+ 'coverage, and the occluded body regions — at that point the garment is already ' +
+ 'live in the wardrobe catalog.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ job_id: { type: 'string', description: 'Job id returned by generate_garment.' },
+ },
+ required: ['job_id'],
+ additionalProperties: false,
+ },
+ async handler(args, auth) {
+ const rl = await limits.mcp3dStatus(auth.userId || auth.rateKey);
+ if (!rl.success) {
+ throw rpcError(-32000, 'rate_limited', {
+ retry_after: Math.ceil((rl.reset - Date.now()) / 1000),
+ });
+ }
+ if (!JOB_ID_RE.test(args.job_id)) throw new Error('malformed job id');
+ const { base, key } = workerConfig();
+ const res = await fetch(`${base}/jobs/${args.job_id}`, {
+ headers: { authorization: `Bearer ${key}` },
+ }).catch(() => null);
+ if (!res) throw new Error('garment worker unreachable');
+ if (res.status === 404) throw new Error('no such garment job');
+ if (!res.ok) throw new Error(`garment worker returned ${res.status}`);
+ const job = await res.json();
+ const pub = {
+ job_id: job.job_id,
+ status: job.status,
+ stage: job.stage || null,
+ glb_url: job.glb_url || null,
+ manifest_url: job.manifest_url || null,
+ thumb_url: job.thumb_url || null,
+ coverage: typeof job.coverage === 'number' ? job.coverage : null,
+ occludes: Array.isArray(job.occludes) ? job.occludes : null,
+ garment_id: job.garment_id || null,
+ error: job.error || null,
+ };
+ const line = pub.status === 'done'
+ ? `Garment ${pub.garment_id} published: ${pub.glb_url} (coverage ${(pub.coverage * 100).toFixed(1)}%, occludes ${pub.occludes?.join(', ') || 'nothing'}).`
+ : pub.status === 'failed'
+ ? `Garment job failed: ${pub.error}`
+ : `Garment job ${pub.status} — stage: ${pub.stage}.`;
+ return {
+ content: [{ type: 'text', text: line }],
+ structuredContent: pub,
+ };
+ },
+ },
+ {
+ name: 'list_garment_catalog',
+ title: 'List the wardrobe garment catalog',
+ annotations: {
+ readOnlyHint: true,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ description:
+ 'Fetch the public three.ws wardrobe catalog: every published garment manifest ' +
+ '(id, slot, name, GLB url, thumbnail, occluded regions). Any entry attaches to ' +
+ 'any humanoid avatar via the additive wardrobe.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ slot: {
+ type: 'string',
+ enum: GARMENT_SLOTS,
+ description: 'Optional: only garments for this slot.',
+ },
+ },
+ additionalProperties: false,
+ },
+ async handler(args, auth) {
+ const rl = await limits.mcp3dStatus(auth.userId || auth.rateKey);
+ if (!rl.success) {
+ throw rpcError(-32000, 'rate_limited', {
+ retry_after: Math.ceil((rl.reset - Date.now()) / 1000),
+ });
+ }
+ const res = await fetch(CATALOG_URL).catch(() => null);
+ if (!res || !res.ok) throw new Error('garment catalog unreachable');
+ const raw = await res.json();
+ const garments = (Array.isArray(raw) ? raw : [])
+ .filter((m) => !args.slot || m?.slot === args.slot)
+ .map((m) => ({
+ id: m.id,
+ name: m.name,
+ slot: m.slot,
+ version: m.version,
+ glb_url: m.model?.uri || null,
+ thumbnail: m.preview?.thumbnail || null,
+ occludes: m.occludes || [],
+ license: m.license,
+ }));
+ return {
+ content: [{
+ type: 'text',
+ text: garments.length
+ ? garments.map((g) => `${g.slot}/${g.id} v${g.version} — ${g.name}`).join('\n')
+ : 'The catalog is empty for that filter.',
+ }],
+ structuredContent: { garments, count: garments.length },
+ };
+ },
+ },
+];
diff --git a/data/changelog.json b/data/changelog.json
index 06692b635..c5d84bb0e 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -15848,6 +15848,15 @@
"infra"
],
"link": "/crypto-api"
+ },
+ {
+ "date": "2026-07-25",
+ "title": "Garment generation is now open to everyone: API and agent tools",
+ "summary": "The garment generator that fills the wardrobe catalog is now a public surface. Developers can create wearables with one HTTP call (POST /api/garment-forge with a description and a slot, then poll the job), and AI agents get the same power through three new MCP tools: generate_garment, garment_status, and list_garment_catalog. Every generated piece is validated end to end before it publishes, appears in the shared catalog immediately, and fits any humanoid avatar. The catalog now covers tops, jeans, sneakers, and a leather jacket, with more slots filling in.",
+ "tags": [
+ "feature",
+ "sdk"
+ ]
}
]
}
diff --git a/docs/mcp.md b/docs/mcp.md
index 5cc66c7b3..730e9d3d0 100644
--- a/docs/mcp.md
+++ b/docs/mcp.md
@@ -607,6 +607,51 @@ Generate a brand-new motion from a natural-language prompt ("waving confidently"
Returns the retargeted three.js `AnimationClip` JSON (or a baked animated GLB) plus a retarget report, the same shape `apply_animation` returns. Requires the text2motion worker configured on the deployment (`GCP_TEXT2MOTION_URL`) — errors with `-32001` if unset. Also reachable outside MCP via `POST /api/forge-motion` (`GET /api/forge-motion?job=<id>` to poll).
+### `generate_garment`
+
+Turn a text prompt ("a red varsity jacket") into a rigged, wearable garment published to the three.ws wardrobe catalog: reference image (Vertex image lane) → PBR mesh (self-host GPU fleet) → skinned to the canonical humanoid skeleton with full-body context (`model-rig`) → validated against every rule in `specs/GARMENT_MANIFEST.md`, including the 60% bind-coverage gate, before publish. Asynchronous (about 7 minutes); poll with `garment_status`.
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "prompt": { "type": "string", "minLength": 3, "maxLength": 500 },
+ "slot": { "type": "string", "enum": ["top", "bottom", "footwear", "outerwear", "hair", "headwear", "glasses", "accessory"] }
+ },
+ "required": ["prompt", "slot"],
+ "additionalProperties": false
+}
+```
+
+Returns `{ job_id, status, eta_seconds }`. The finished garment appears in the public catalog automatically and attaches to any humanoid avatar via the additive wardrobe (`docs/avatar-wardrobe.md`). Requires `GCP_GARMENT_FORGE_URL` on the deployment — errors with `-32001` if unset. Also reachable outside MCP via `POST /api/garment-forge`.
+
+### `garment_status`
+
+Poll a `generate_garment` job. While running, reports the pipeline stage (`image → mesh → compose → rig → extract → validate → publish`); when done, returns the published `glb_url`, `manifest_url`, thumbnail, measured bind `coverage`, and the occluded body regions.
+
+```json
+{
+ "type": "object",
+ "properties": { "job_id": { "type": "string" } },
+ "required": ["job_id"],
+ "additionalProperties": false
+}
+```
+
+### `list_garment_catalog`
+
+Fetch the public wardrobe catalog: every published garment manifest (id, slot, name, GLB url, thumbnail, occluded regions, license), optionally filtered by `slot`. Any entry attaches to any humanoid avatar.
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "slot": { "type": "string", "enum": ["top", "bottom", "footwear", "outerwear", "hair", "headwear", "glasses", "accessory"] }
+ },
+ "additionalProperties": false
+}
+```
+
---
## Rate limits
diff --git a/public/changelog.json b/public/changelog.json
index d134267b1..071e1a659 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-25T12:21:32.735Z",
+ "generated_at": "2026-07-25T12:24:17.092Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -112,6 +112,17 @@
"feature"
]
},
+ {
+ "date": "2026-07-25",
+ "type": "update",
+ "title": "Garment generation is now open to everyone: API and agent tools",
+ "summary": "The garment generator that fills the wardrobe catalog is now a public surface. Developers can create wearables with one HTTP call (POST /api/garment-forge with a description and a slot, then poll the job), and AI agents get the same power through three new MCP tools: generate_garment, garment_status, and list_garment_catalog. Every generated piece is validated end to end before it publishes, appears in the shared catalog immediately, and fits any humanoid avatar. The catalog now covers tops, jeans, sneakers, and a leather jacket, with more slots filling in.",
+ "link": null,
+ "tags": [
+ "feature",
+ "sdk"
+ ]
+ },
{
"date": "2026-07-25",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 6f965b1f6..e518e147d 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -86,6 +86,14 @@
<category>feature</category>
<description>Until now the wardrobe could only recolour or hide the clothes an avatar was generated with. It can now put NEW clothes on: the avatar editor's Wardrobe tab gained a Closet with racks of catalog pieces (tops, bottoms, footwear, outerwear, hair, headwear, glasses, accessories). Click a piece and it binds to your avatar's skeleton and moves with every animation, whatever generator the avatar came from: forge characters, selfie reconstructions and uploaded models all work, because garments are fitted to the skeleton at wear-time instead of being authored for one specific body. The body is masked under whatever you wear so skin never pokes through the cloth, a piece that cannot fit a particular skeleton politely refuses instead of deforming into spaghetti, and every download is integrity-checked against the catalog before it touches your avatar. Saved outfits persist: the downloadable and embedded versions of your avatar come out dressed too.</description>
</item>
+ <item>
+ <title>Garment generation is now open to everyone: API and agent tools</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-25:Garment generation is now open to everyone: API and agent tools</guid>
+ <pubDate>Sat, 25 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The garment generator that fills the wardrobe catalog is now a public surface. Developers can create wearables with one HTTP call (POST /api/garment-forge with a description and a slot, then poll the job), and AI agents get the same power through three new MCP tools: generate_garment, garment_status, and list_garment_catalog. Every generated piece is validated end to end before it publishes, appears in the shared catalog immediately, and fits any humanoid avatar. The catalog now covers tops, jeans, sneakers, and a leather jacket, with more slots filling in.</description>
+ </item>
<item>
<title>Our crypto API no longer reports itself as broken to the directories that rate it</title>
<link>https://three.ws/crypto-api</link>
diff --git a/public/features.json b/public/features.json
index 625e09769..a2d8ac0ea 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-25T11:31:37.117Z",
+ "generated_at": "2026-07-25T12:24:17.086Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",