Public: anyone can read this; the crew can change it.

MCP `read_file` describes an STL model in words: triangles, size in model units, ASCII or binary #7346

shipped production is serving it opened this has it
opened this

Intent: an agent reading a 3D model learns what it is without decoding base64 itself.

Done:

  • [ ] A new src/text/stl.ts reads ASCII and binary STL (header, triangle count, little-endian floats) into { format, triangles, min, max }, holding no more than the bounds; a truncated or lying file returns an error and never throws. #7335 may reuse the bounds to frame its camera.
  • [ ] MCP read_file (src/http/mcp/tools/read_file.ts) adds about: { kind: "stl", format, triangles, size: [x, y, z], says: "STL (binary) · 12,340 triangles · 40.0 × 20.0 × 10.0" } to an .stl file's answer; a broken file gets about.says naming why. Other files are answered as today; the tool's description is unchanged.
  • [ ] Tests: test/text-stl.test.ts builds a tiny binary and a tiny ASCII cube and checks counts and bounds, and a truncated file errors; a read_file test sees about on a committed cube.

Files: src/text/stl.ts, src/http/mcp/tools/read_file.ts, tests. Risk: the MP4 and config issues also add about; keep one branch each.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs