Passing the mochi argument to the MCP server’s inspect compiles .mochi.xml with MoCHI and returns diagnostics, counts of generated objects, and layout counts as JSON. inspect reads files from disk, so save first, or pass unsaved text in text and files.
The arguments you can write inside mochi are the following 7.
Arguments
Description
path
The entry point .mochi.xml that describes the whole world. Written as a path from the project root (starting with Assets/ or Packages/). An absolute path inside the project is also accepted.
projectPath
The Unity project folder. If omitted, uses the folder passed to the server at startup.
text
The text of the file at path. When passed, this text is read instead of what is saved at path. The file need not exist at path.
files
An array of the text of parts or tables ([{ "path": …, "text": … }]). Each is read instead of the file saved at the same path, and a part that is not saved is found the same way as a saved one. Paths are written the same way as path.
tree
true returns tree. Not returned by default.
svg
true returns layout.svg. Not returned by default.
gltf
true also writes the same boxes as svg as a 3D file (.gltf) under Library/MoCHI/Preview/ in the project, and returns its path in layout.gltf. Not written by default.
A client set up through the Tsukimi MCP window passes the project folder at startup, so it can usually be omitted.
Specifying it together with source or sources
Results in a tool error (isError: true).
A part’s file
Parts are checked where they are used, so passing a part’s file makes props without a default produce MOCHI3008.
prefab="true"
Not checked. Every .mochi.xml passed is compiled as an entry point.
What it reads and writes
Reads what is on disk and the text passed in text and files. The only thing it writes is one .gltf file with gltf: true, which is not a generated file. The text in text and files is not written to the project.
Definitions kept from generation
A definition kept as X.mochi.xml.txt so that Unity does not generate it can also be checked: put its text in text and give the .mochi.xml path as path (passing the .txt path as it is gives MOCHI2001).
Part with a T# script
Can’t be checked from text alone, because it needs the program asset that Unity makes from the saved .cs file.
There are 14 top-level keys (counts, layout, and tree are present only when compiles is true and while waiting for the T# scripts to compile; outputs is present only when compiles is true).
Key
Description
schemaVersion
The version of the JSON format (currently 1).
entry
The normalized entry point path.
project
root (the project folder) and from (argument or startup).
compiles
true when there are no errors and the prefab can be written. Doesn’t indicate whether the world looks correct.
Present only when there are no errors but a T# script’s compile is pending. message and files (paths of the <Name>.Mochi.cs to be generated).
counts
objects (the number of GameObjects, including the root), prefabInstances (the number of prefab instances; their insides aren’t counted), components (the number of components MoCHI added), partsUsed (the usage count per part name; the entry point itself isn’t counted).
layout
The box counts, the counts of overlaps and overflows, and walking distances (layout).
tree
Present only when tree: true. An array of strings listing the expanded GameObjects, one per line (tree).
treeOmitted
Present only when there are more than 300 lines.
outputs
prefab (bytes and sha256), files (path and bytes of material copies and their .meta), behaviourFiles (path and bytes of the <Name>.Mochi.cs to be generated). Doesn’t include the prefab’s path.
generated
Whether the prefab Unity made from this entry point was made from the current input. It has state, prefab (the prefab’s path; null for notGenerated) and message (an English explanation), and is always present (generated).
file (path from the project root), startLine, startCol, endLine, endCol. Start and end are the same position, and a diagnostic with no location is line 1, column 1.
The least exact source of the box sizes used: written (a size you wrote), then mesh (mesh bounds), then collider (colliders). A size you wrote, the box of a <Row> or <Grid>, and a placed part whose root has a size are written. When a <Row> or <Grid> measures a <Prefab> without size by the bounds of its visible meshes, the box of the <Row> or <Grid> is still written, and the boxes inside the placed prefab are mesh or collider.
measured
The number of GameObjects that have size.
notMeasured
The number of GameObjects without size. These are counted in overlaps and overflows only when a box can be made from a mesh or a collider.
boxes
The number of boxes by source (written, mesh, collider; all 3 are always present). Meshes and colliders get one box each.
skipped・trigger・disabled・mesh・model・other
The number of things not made into a box, by reason: trigger (colliders you can pass through), disabled (colliders or Renderers whose enabled is false), mesh (meshes whose size cannot be read, such as a mesh inside a model Unity has not read yet), model (things inside a placed model), other (Terrain, TerrainCollider, WheelCollider, CharacterController). All 5 are always present.
overlapCount・overlaps
The number of overlapping pairs, and an array of pairs (a, b, depth). Pairs are counted per object: two objects that overlap through several boxes are one pair, and a and b are the boxes that overlap the deepest. Deepest first, up to 50.
overflowCount・overflows
The number of overflows and an array (object, container, amount). Up to 50 entries, largest first.
overlapsOmitted・overflowsOmitted
Present only when entries were omitted from the array.
canvasCount・canvases・sizeDelta・height
The number and the array of World Space Canvas roots. Each element has path, identity, at, sizeDelta (value, and from as written or default), and width and height (the width and height of the rectangle, in meters). In tree order, at most 50.
inFrontOfCanvasCount・inFrontOfCanvas・canvas
The number and the array of meshes and colliders on the viewing side of a Canvas that appear over the Canvas (In front of a Canvas). Each element has canvas (path, identity, at), object (the same shape as a in overlaps) and distance (from the plane of the Canvas, in meters), and a box that is not active gets inactive. Nearest first, at most 50.
canvasesOmitted・inFrontOfCanvasOmitted
Present only when entries were omitted from the array. A sentence giving the number omitted.
svg
Present only when svg: true. A floor plan viewed from above.
svgOmitted
Present only when there are more than 150 boxes and the picture was left out.
gltf
Present only when the file was written with gltf: true. path (from the project root), boxes (the number of boxes), bytes and sha256.
gltfOmitted
Present only when nothing was written with gltf: true. A sentence giving the reason (no Library/, the file does not compile, too many boxes, or the file could not be written).
walk
Present only when there is a start point (layout.walk).
walkOmitted
Present only when walking was not measured. A sentence giving the reason (no start point, no floor, and so on). Exactly one of walk and walkOmitted is present.
a・b・object・container
The a and b in overlaps elements and the object and container in overflows elements have path (the sequence of names from the root), identity (identity), at (where it was written, file:line:column) and from (the source of the box). A box inside a placed prefab also has inside (the sequence of names from the prefab’s root), and a box from a mesh or collider also has component (the type of the component that made it). path isn’t necessarily unique, so <For> siblings are told apart by identity.
Overlap
Judged between boxes, using oriented boxes. Boxes come from sizes you wrote (objects with a size, <Row> and <Grid>, and placed parts whose root has a size) and from the meshes and colliders MoCHI can read. An object with a size gets no box from its own meshes and colliders. Pairs that only touch at a face, pairs of a written-size box and a box below it, and boxes of the same object (including boxes inside the same prefab instance) are not counted.
Overflow
The distance outside the box of the nearest ancestor with a size you wrote. Boxes from meshes and colliders never hold anything. A direction in which the container has no thickness (a flat thing like a floor) is not measured.
Number rounding
Decimal, rounded to 0.0001 units in meters.
The svg diagram
Right is +X, up is +Z, in meters. In each overlapping pair only the smaller box is filled red (both when they are the same size), and overflowing boxes get an orange outline. Boxes from meshes and colliders are dashed. Each box’s <title> holds the sequence of names from the root.
A Canvas and the UI under it have no box, so an object standing in front of a Canvas is not counted as an overlap. layout.inFrontOfCanvas lists the objects in front of a Canvas instead
The rectangle
The rectangle of a World Space Canvas root written in the markup. Its size is sizeDelta, its place is set by pivot and the GameObject’s position, rotation and scale, and it has no thickness.
Viewing side
The −Z direction of the Canvas’s local coordinates.
Boxes counted
Mesh and collider boxes that come within 0.5 m on the viewing side of the rectangle and, projected onto the rectangle’s plane, overlap the rectangle. A box that passes through the rectangle is counted at distance 0. Boxes that are not active are counted too, with inactive.
Not counted
Boards in the same plane as the rectangle, objects behind the rectangle, objects that only touch its edge, written sizes (size), boxes of that Canvas and of the objects under it, Screen Space canvases, nested canvases, and canvases inside a placed prefab.
Grouping
One entry per pair of a Canvas and an object, keeping the object’s nearest box
Walks a body over the floor from a start point, and returns, for each object in the way, how far it is and how wide a body can still get to it. How it walks is set with attributes on the root element of the entry point.
walkFrom (the start point), playerRadius (the body’s radius), playerHeight (the body’s height) and minPassageWidth (the passage width you want) on the root element of the entry point. Values and defaults are in Root element. They are not written into the prefab. On the root element of a part that is not an entry point they are MOCHI1005, and a value out of range or a binding {…} is MOCHI1009. When an entry point is used as a part in another entry point, its settings do not apply.
Start point
walkFrom comes first. Without it, the first target of the spawns of a VRCSceneDescriptor written in the markup. A VRCSceneDescriptor inside a placed prefab is not read. With 2 or more VRCSceneDescriptors, or empty spawns, the result is walkOmitted.
Floor
Among the boxes directly below the start point whose top is within 0.05 m of the start’s y, the highest top is the floor height. Every box whose top is within 0.05 m of that height is floor, and walking is on a 0.1 m grid. Steps, slopes and floors at another height are not climbed.
What blocks the way
Boxes that reach into the band from 0.05 m above the floor up to playerHeight plus 0.4 m. A mesh box without a collider blocks too. A box that holds other boxes (<Row>, <Grid>, an object with a size and children) is walked through.
Distance
The length of a path on the grid. It comes out up to about 8% longer than a straight line.
Pictures
Not drawn in svg or gltf.
Key
Description
start・position・spawnCount・spawn
The start point: from (walkFrom or spawns), position (coordinates from the root of the prefab) and at (where it was written). With spawns, also spawnCount (the number of spawns) and spawn (the sequence of names of the first target).
floor・y・cells・area
The floor walked on: y (its height), boxes (the number of floor boxes), cells (the number of 0.1 m cells) and area (the area you can stand on, in square meters).
The values used. playerRadius, playerHeight and minPassageWidth each have value and from (default or written) (the default of minPassageWidth is null). Also bodyWidth (the body’s width), blocksFrom and blocksTo (the heights that block the way), grid (the grid spacing, 0.1) and widthLimit (the widest width measured).
blockers・containers・inactive
The number of boxes that block the way, of container boxes walked through, and of boxes ignored because they are not active.
exhibitCount・reachedCount・unreachedCount
The number of objects in the way (exhibits), and how many of them are reached and not reached. An exhibit is the boxes of one object taken together.
exhibits・reached・distance・width・via
The array of exhibits. Reached ones first, nearest first, then the ones not reached, up to 50. object (path, identity, at, and inside for an object inside a placed prefab), reached, distance (meters walked to stand where it can be touched; null when not reached) and width (the widest body that can come up to it). via is present only when an object with no room to stand next to it (one on a stand, or set into a wall) is reached through the object it touches, and names that object. Then distance and width are that object’s values.
exhibitsOmitted
Present only when there are more than 50 exhibits.
The number and array of floor areas with room for the body that cannot be reached from the start point. Largest first, up to 20, each with area, min and max (x and z), point (one point in it, x and z) and width (the widest body that can get there).
unreachableAreasOmitted
Present only when there are more than 20 unreachable areas.
narrowest・toward
The narrowest width on the way to a reached exhibit, the point (x and z) that sets it, and the object that way leads toward. Present only when something is reached.
belowMinPassageWidth・belowMinPassageWidthOmitted
Present only when minPassageWidth is written. An array of the exhibits whose width is narrower than minPassageWidth, narrowest first, up to 50 (object, width, reached), and a sentence when some were left out.
state is one of the following 7. The rules are the same as when Unity generates, and when text or files is passed, the comparison is with the text passed (message says so too).
state
Meaning
upToDate
There is a prefab made from the current input.
stale
The prefab differs from the current input, or has not been made yet. A saved change stays in this state until Unity imports it and makes the prefab again.
handEdited
The generated files were changed by hand after they were generated, so generation is paused.
failed
It cannot be made because of an error. message is the first error.
stopped
The prefab was deleted, so generation is stopped.
waitingForCompile
Waiting for the T# scripts of parts to compile.
notGenerated
A file Unity does not make a prefab from: a part whose root element has no prefab="true", a file under Packages/, or an entry point passed only as text and not saved. prefab is null.
Indent, name, <written tag>, @file:line:column (file omitted when it’s the same as the parent), and, when different from the default: pos, rot, scale, size, pivot, prefab <path>, mount <target>, components A,B, overrides n, inactive.
Use
A format meant for people and AI to read; the separators aren’t a fixed format.
A way of writing that isn’t supported yet. Use a different form. Not something to report as a defect.
MOCHI2009
The asset doesn’t have a .meta yet. Let Unity import it, then check again.
MOCHI8001
A part, or a binding that calls a function, needs T#, but T# is not in this environment.
MOCHI3016
The T# script fails to compile together with MoCHI’s generated file. Fix what is at the location shown: the .cs, or the binding in the .mochi.xml that the failing line in the generated file was made from.
MOCHI2014
An unneeded <Name>.Mochi.cs is left behind (warning). Delete it if it’s unused.
How the world looks, lighting, how it feels to walk through
Not answered. Check in Unity.
Collisions between things without a box
Not counted. Boxes are made only from sizes you wrote and from the meshes and colliders MoCHI can read. Zero overlaps is not evidence that nothing collides. A Canvas and the UI under it have no box either, so look at layout.inFrontOfCanvas for objects in front that hide the UI.
Changes Unity has not imported yet
generated compares with the files on disk, so a saved change stays stale until Unity imports it.