Skip to content

inspect

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.

{ "mochi": { "path": "Assets/Gallery/Gallery.mochi.xml", "tree": true } }

The arguments you can write inside mochi are the following 7.

ArgumentsDescription
pathThe 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.
projectPathThe Unity project folder. If omitted, uses the folder passed to the server at startup.
textThe 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.
filesAn 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.
treetrue returns tree. Not returned by default.
svgtrue returns layout.svg. Not returned by default.
gltftrue 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.

An example that passes unsaved text.

{ "mochi": { "path": "Assets/Go/GoPuzzle.mochi.xml", "text": "<GoPuzzle prefab=\"true\">…</GoPuzzle>",
"files": [ { "path": "Assets/Kit/Frame.mochi.xml", "text": "<Frame>…</Frame>" } ] } }
Omitting projectPathA 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 sourcesResults in a tool error (isError: true).
A part’s fileParts 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 writesReads 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 generationA 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# scriptCan’t be checked from text alone, because it needs the program asset that Unity makes from the saved .cs file.
The same path passed twice, or the wrong shapeResults in a tool error (isError: true).

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).

KeyDescription
schemaVersionThe version of the JSON format (currently 1).
entryThe normalized entry point path.
projectroot (the project folder) and from (argument or startup).
compilestrue when there are no errors and the prefab can be written. Doesn’t indicate whether the world looks correct.
diagnosticsAn array of diagnostics (Diagnostic element).
diagnosticsOmittedPresent only when there are more than 100 diagnostics. A sentence stating the number omitted.
summarytotal, bySeverity, byOrigin. Counts omitted diagnostics too.
waitingForCompilePresent 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).
countsobjects (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).
layoutThe box counts, the counts of overlaps and overflows, and walking distances (layout).
treePresent only when tree: true. An array of strings listing the expanded GameObjects, one per line (tree).
treeOmittedPresent only when there are more than 300 lines.
outputsprefab (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.
generatedWhether 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).
KeyDescription
codeThe MOCHInnnn code.
severityerror or warning.
messageAn English description.
locationfile (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.
originThe cause category (Cause category).
explain・fix・witness・pathA key kept for parity with T#‘s diagnostic key order; always null.
KeyDescription
sizeFromThe 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.
measuredThe number of GameObjects that have size.
notMeasuredThe 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.
boxesThe 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・otherThe 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・overlapsThe 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・overflowsThe number of overflows and an array (object, container, amount). Up to 50 entries, largest first.
overlapsOmitted・overflowsOmittedPresent only when entries were omitted from the array.
canvasCount・canvases・sizeDelta・heightThe 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・canvasThe 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・inFrontOfCanvasOmittedPresent only when entries were omitted from the array. A sentence giving the number omitted.
svgPresent only when svg: true. A floor plan viewed from above.
svgOmittedPresent only when there are more than 150 boxes and the picture was left out.
gltfPresent only when the file was written with gltf: true. path (from the project root), boxes (the number of boxes), bytes and sha256.
gltfOmittedPresent 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).
walkPresent only when there is a start point (layout.walk).
walkOmittedPresent 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・containerThe 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.
OverlapJudged 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.
OverflowThe 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 roundingDecimal, rounded to 0.0001 units in meters.
The svg diagramRight 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.
Difference from overlapsA 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 rectangleThe 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 sideThe −Z direction of the Canvas’s local coordinates.
Boxes countedMesh 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 countedBoards 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.
GroupingOne 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.

<Gallery prefab="true" walkFrom="0 0 -4" minPassageWidth="1.2">
…
</Gallery>
ConfigurationwalkFrom (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 pointwalkFrom 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.
FloorAmong 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 wayBoxes 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.
DistanceThe length of a path on the grid. It comes out up to about 8% longer than a straight line.
PicturesNot drawn in svg or gltf.
KeyDescription
start・position・spawnCount・spawnThe 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・areaThe 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).
values・playerRadius・playerHeight・minPassageWidth・value・bodyWidth・blocksFrom・blocksTo・grid・widthLimitThe 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・inactiveThe number of boxes that block the way, of container boxes walked through, and of boxes ignored because they are not active.
exhibitCount・reachedCount・unreachedCountThe 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・viaThe 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.
exhibitsOmittedPresent only when there are more than 50 exhibits.
unreachableAreaCount・unreachableAreas・min・max・pointThe 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).
unreachableAreasOmittedPresent only when there are more than 20 unreachable areas.
narrowest・towardThe 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・belowMinPassageWidthOmittedPresent 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).

stateMeaning
upToDateThere is a prefab made from the current input.
staleThe 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.
handEditedThe generated files were changed by hand after they were generated, so generation is paused.
failedIt cannot be made because of an error. message is the first error.
stoppedThe prefab was deleted, so generation is stopped.
waitingForCompileWaiting for the T# scripts of parts to compile.
notGeneratedA 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.
Line formatIndent, 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.
UseA format meant for people and AI to read; the separators aren’t a fixed format.

A diagnostic’s origin is one of the following 3 kinds, each fixed in a different place.

CategoryMeaningWhat to doNumber count
subsetMarkup MoCHI doesn’t accept, or doesn’t support yet.Fix the markup.45
environmentSomething in the project (a file, image, table row, or import) is missing or not ready.Fix the project.14
toolAn error that’s unlikely to be the writer’s mistake.Report it with the file attached.2
NumberMeaning and how to handle it
MOCHI9001A way of writing that isn’t supported yet. Use a different form. Not something to report as a defect.
MOCHI2009The asset doesn’t have a .meta yet. Let Unity import it, then check again.
MOCHI8001A part, or a binding that calls a function, needs T#, but T# is not in this environment.
MOCHI3016The 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.
MOCHI2014An unneeded <Name>.Mochi.cs is left behind (warning). Delete it if it’s unused.

All the codes are in Errors.

What it runsHandling
How the world looks, lighting, how it feels to walk throughNot answered. Check in Unity.
Collisions between things without a boxNot 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 yetgenerated compares with the files on disk, so a saved change stays stale until Unity imports it.
Unsaved changesNot visible unless passed in text and files.
T#‘s compile stateCan’t tell whether it compiled from the latest source (Two-stage generation).
Explanations of MOCHI codesT#‘s diagnostics tool handles only TUKI codes; MOCHI codes aren’t listed there. Judge by the cause category instead.