Skip to main content
Glama

model_run

Runs JavaScript against a persistent three.js scene to build 3D models in code and save them as GLB files for the page to load.

Instructions

Runs JavaScript against the modelling scene: a three.js scene this server keeps between calls, apart from any page, for building a model in code as in Blender, then saving it as a .glb the page loads. The code is an async function body with THREE, BufferGeometryUtils (mergeGeometries, mergeVertices), scene, geo (Manifold, started: geo.Manifold, geo.CrossSection, geo.toGeometry(manifold), geo.toManifold(geometry), geo.boolean(op, a, ...b)), scatter, find(name), stats(target) (vertices, triangles, bounds, closed, volume, genus per mesh), load(path) (a .glb, .obj or .fbx from the project, an asset_search pick included, added to the scene and returned), save(path, object = scene) (a GLB under cwd; replies with its size and the line that loads it) and clear() in scope, and returns what it returns, as JSON, with up to 5 lines it logged. What it adds to scene stays for the next call and is saved to paprika3d/model/scene.glb after each run that changed it, so a restart loads it back; variables (a Manifold) do not last between calls. Manifold works in metres with Z up and angles in degrees; three is Y up. Name every object you make: model_look lists them by name. Search asset_search first for a character, vehicle, building, plant or prop; build here what no search finds or the design makes by rule, saying why in searched.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cwd": "<cwd>",
      "code": "<code>"
    },
    "name": "model_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesThe game project's folder.
codeYesAn async function body, e.g. `const { Manifold, toGeometry } = geo; const m = Manifold.cube([1, 1, 1], true).subtract(Manifold.sphere(0.65, 48)); const mesh = new THREE.Mesh(toGeometry(m), new THREE.MeshStandardMaterial({ color: 0xb08050 })); mesh.name = "block"; scene.add(mesh); return stats(mesh)`.
searchedNoOptional: why this is built in code ("by design: terrain"), logged for the critic.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.5
    • addedInput schema / properties / searched
      Added value: +{
      +  "description": "Optional: why this is built in code (\"by design: terrain\"), logged for the critic.",
      +  "type": "string"
      +}
  2. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations (readOnlyHint=false, openWorldHint=true) by disclosing that scene additions persist across calls, are auto-saved to paprika3d/model/scene.glb after any run that changed the scene, and reload on restart, while local variables do not persist. It also discloses the return contract (JSON plus up to 5 log lines) and the coordinate conventions (Manifold metres/Z-up/degrees vs three Y-up), which are non-obvious traps. Missing only things like runtime limits or failure behavior on bad code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and appropriately sized for a tool with this much runtime surface; nearly every clause carries information. The cost is structure: the scope list is buried in a long parenthetical run-on, so the agent must parse rather than scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a code-execution tool with no output schema, the description covers the full burden: execution model, available bindings, persistence and save location, coordinate systems, return shape, naming convention, and routing to asset_search. An agent can invoke it correctly without further inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already carries a full worked example for `code`, so the baseline is 3. The description still adds real meaning by enumerating the in-scope bindings (THREE, BufferGeometryUtils, scene, geo/Manifold helpers, scatter, find, stats, load, save, clear) and by tying `searched` to the critic workflow, so it earns above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Runs JavaScript against the modelling scene' — and immediately scopes it as a persistent three.js scene kept by the server, apart from any page, for building a model in code and saving it as a .glb. It is clearly distinguished from siblings: asset_search is named as the lookup alternative and model_look as the inventory of named objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing rule: search `asset_search` first for a character, vehicle, building, plant or prop; build here what no search finds or what the design makes by rule, and record the reason in `searched`. That is a when-to-use and a when-not-to-use condition plus the named alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.