Docs

One protocol, three ways in

The protocol

Studio, an assistant connected to https://mcp.beforewear.com/, and a script using the Python SDK do the same things with the same names: garments, designs, presets, mockups, print files and your balance. Every call acts for one Beforewear organization, the one the token belongs to.

A design made over MCP or from code is the same design Studio keeps: it opens there as it is, and a design saved in Studio is read and changed the same way from code.

Resources

ResourceWhat it isIts id
GarmentA built garment in the library: its sizes, each built and checked, and the areas each takes print on.its key, e.g. vb-py-aop-hood
DesignYour design on one garment at one size: a base colour and layers, in the order they print. Studio opens it as it is.a uuid
LayerOne thing on a design: a print (a pattern over the whole garment), your artwork, a motif, lettering, or the design generator's drawing.short, e.g. l3
PresetThe library's ready-made looks: patterns and motifs go on as they are, free; murals and abstracts are words for the design generator.a uuid
MockupMockups of a design on the garment's own models: male for men's garments, female for women's, both for unisex.mockups, not kept
Print filesA design as the printer takes it: a PNG per piece at 150 dpi, in a ZIP with its README.a link, for an hour
BalanceYour organization's dollars: what is there, and what was added and used.one per organization
BuildYour garment built from your sewing pattern or a 3D model, at the sizes you ask, on the computer you pick, stopped at your cap. It ends as your garment, in every size built.a uuid

Tools

The MCP server publishes these tools; the SDK calls the same ones (bw.designs.place is design.place).

ToolDoesCosts
garment.listThe garments you can design on: yours (at the sizes whose look you accepted in Studio), then the library's, each with its sizes.free
garment.get(garment_id)One garment, yours or the library's: each size's build, check, fit and states.free
preset.list(kind?)Patterns (with their repeat in cm and background), motifs (with their width), murals and abstracts (words for design.generate).free
design.list(limit?)Your designs, the last saved first.free
design.get(design_id)One design: its base colour, layers and areas, and the Studio link that opens it.free
design.create(garment_id, size, name, base_colour?, preset_id?)A new design. A pattern preset prints over the whole garment, on its background unless a base colour is given.free
design.update(design_id, name?, base_colour?, preset_id?)Its name, base colour or print.free
design.place(design_id, area, artwork | text | preset_id, width_cm?, x?, y?, rotate?, colour?)Puts one layer on an area: your file (attached, an https link, or sent as a data URL), lettering, or a motif. Kept where it can print.free
design.place(design_id, layer_id, …)Moves, resizes, turns or recolours a layer; changes lettering's words.free
design.remove(design_id, layer_id)Takes a layer off.free
design.delete(design_id)Forgets the design.free
design.generate(design_id, prompt)The design generator draws from words onto the design's pieces; on a design already drawn, the words change the drawing. A run takes minutes.a generated design's price, from the balance
design.get_generation(handle, wait_sec?)How a run is going (waits up to 50 s); once drawn, the design with the drawing on it.free
design.export(design_id)The print files, behind a link for an hour.free
mockup.render(design_id, models?, views?)The garment's own models wearing the design; the mockups come back in the answer. Views: front, side, back, torso.free
design.show(design_id)The design in 3D on its garment, in Studio's viewer, where the assistant's host draws apps; elsewhere the Studio link. Not in the SDK.free
garment.show(garment_id, size)A garment as built at one size, in 3D, each piece in its own colour. Not in the SDK.free
balance.getThe balance in dollars and the last entries.free
build.price(sizes)What a build of the sizes comes to, about, and how long it takes: New garment's price, and the cap a build stops at unless you say.free
build.request(words, pattern? | model? | files? | start_from + changes?, name?, sizes?, technique?, fabric?, cap_dollars?)Studio's New garment: what the person wants, in their words, with their sewing pattern (DXF or PDF) or a 3D model (GLB or OBJ), and a size chart and photos if they have them; or a library garment from build.list's starts, with their changes (its options, a zip's length, each size cut as another). What the call does not say is read as Studio reads it. It waits for its computer.its cap is held; charged for its computer's time and its AI's work
build.get(build_id) · build.listWhere a build stands, size by size: the step each size is at, what its computer said in plain words, what it has come to against its cap, and what it asks.free
build.answer(build_id, answers)Sends the person's answer to what a build asks; it starts again on a computer of its own.nothing while it waits; charged once, at its end
build.send(build_id, pattern? | files?, sizes?, cap_dollars?)The file an ended build refused a size for, which the size names: a build of those sizes starts with it, of the same garment.its own cap is held; charged for its own computer's time and AI work
build.cancel(build_id)Calls off a build: waiting for its computer, its cap is released whole; running, it stops at its computer's next report; waiting for an answer, it ends then.what it used up to then

Areas and places

An area is named as a person reads it: front, back, left sleeve(the wearer's left), right hood, pocket. A design lists its areas with their size in cm. A layer's place is its middle as shares of the area (x from the left as you look at the piece, y from the top) and its width in cm; a layer is kept where it can print, and the answer says when it had to be moved or made smaller.

A design's layers print in order: print (a pattern preset over the whole garment), artwork, motif, lettering, generated(the design generator's drawing on every piece). Each has an id, which design.place and design.remove take.

Scopes

garment:read, design:read, design:write, mockup:write, balance:read, build:write. A personal token made in Studio, under Connect, holds every one of them; an assistant's, the ones the person agreed to when connecting it.

Errors

A refusal says why in a sentence: an unknown garment, a size not built, an area the garment does not have, a balance that does not cover the call. The SDK raises NotAuthorized (no token, or one the server does not take), Refused and NotEnoughFunds (funds are added in Studio, on the account page).

Builds Coming soon

A build makes the garment a person describes, in their words, from their sewing pattern or a 3D model, at the sizes they ask. Beforewear's engine runs it on a computer of its own, size by size, with a check after each, and it ends as their garment in every size built. Asking holds its cap on your balance; it is charged for its computer's time and its AI's work, and what it did not use is released. Where only the person can say something about their garment, the build stops and asks; it starts again with their answer, and nothing is charged while it waits. A size it cannot make from the files it has is refused, naming the file that would let it be built where one would; once the build has ended, sending that file starts a build of the size. A build asked for waits for its computer, and may be cancelled until one takes it, with nothing charged. The tools: build.price, build.request, build.get, build.list, build.answer, build.send, build.cancel, with the scope build:write to ask, answer and send.