Skip to main content
Glama

Render Preview

render_preview

Use this when you need to LOOK at a kernelCAD model — render its script to deterministic PNG views for visual self-check (the visual half of the evaluate → render → inspect → fix loop), with NO studio or dev server required. Pass { code } (inline source) or { file } (a .kcad.ts path), exactly one. Renders the canonical engineering views (front, right, top, iso — pass { views } for a subset, e.g. ["iso"] for fastest iteration) plus an optional { pose: "," } arbitrary camera angle (degrees; az=0,el=0 is front, +az rotates CCW around +Z, +el lifts the camera). NO STUDIO / DEV-SERVER REQUIRED: a prebuilt static player (dist/headless-player) is served from an ephemeral local port automatically; a running studio dev server is used as fallback, and { base_url } forces one. The only environment dependency is playwright chromium (npx playwright install chromium). Pass { focus } or { hide } (arrays of feature ids or assembly part names, mutually exclusive) to isolate parts — same semantics as kernelcad render --focus/--hide. PNGs are written to { out_dir } (default: a fresh temp session directory) and returned as absolute paths with per-view camera descriptions (kernelCAD is Z-up). Mechanism truth runs first, same protocol as kernelcad render: a broken mechanism still renders but every tile is watermarked MECHANISM BROKEN (KERNELCAD_RENDER_STRICT=1 refuses instead); read { mechanism, mechanism_failure_codes }. The probe runs full BREP interference sweeps and can dominate latency on large assemblies — pass { no_mechanism_check: true } for fast iteration (the preview then reports mechanism: "unverified"; ignored under strict mode). Returns { ok, images: [{ name, path, description }], out_dir, bounds, mechanism, render_source, render_ms, diagnostics }. PATHS ARE LOCAL to the machine running the MCP server — local stdio clients read them directly; hosted/remote clients should use open_in_studio instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoInline kernelCAD script source. Mutually exclusive with file. Relative imports resolve against a temp dir — use file for scripts with relative lib.fromSTEP(...) imports.
fileNoPath to a .kcad.ts script on disk. Mutually exclusive with code.
hideNoHide matching feature ids / assembly part names. Mutually exclusive with focus.
poseNoExtra arbitrary camera pose '<az>,<el>' in degrees, e.g. '30,20'.
focusNoShow only matching feature ids / assembly part names. Mutually exclusive with hide.
viewsNoCanonical views to render as an array, e.g. ["iso"] or ["front","top"] (default: all four). Fewer views = faster.
widthNoPer-view tile width in px (default 768).
heightNoPer-view tile height in px (default 768).
out_dirNoDirectory for the PNGs (created if missing). Default: a fresh temp session dir.
base_urlNoAdvanced: force a specific render server (e.g. a running studio dev server) instead of the bundled static player.
environmentNoHDRI environment override: preset ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse'), a URL, or 'none' for the default three-light rig.
no_watermarkNoSuppress the kernelCAD version watermark.
no_mechanism_checkNoSkip the mechanism-truth probe for fast iteration on large assemblies; the preview reports mechanism: 'unverified'. Ignored under KERNELCAD_RENDER_STRICT=1.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the preview rendered.
errorNo
boundsNoModel AABB in mm { min, max } the camera was fit to (success).
imagesYesRendered tiles { name, path, description } — absolute local PNG paths with per-view camera orientation (kernelCAD is Z-up).
out_dirNoDirectory holding the PNGs (session temp dir unless out_dir was given).
errorCodeNo
errorHintNo
mechanismNoMechanism-truth verdict: 'real' | 'broken' | 'unverified'.
render_msNoWall-clock render time in ms (provisioning + browser + captures).
diagnosticsYes
render_sourceNoLane that served the render: 'static-player' | 'dev-server' | 'explicit'.
mechanism_failure_codesNoDe-duplicated failure codes when mechanism is 'broken'.

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only mark readOnlyHint=false, openWorldHint=true, destructiveHint=false. The description adds extensive behavioral details: it writes PNGs to disk (local paths, temp dirs), requires playwright chromium, runs mechanism truth (with watermark on failure), and explains that paths are local-machine only. It also clarifies behavior under KERNELCAD_RENDER_STRICT=1 and no_mechanism_check. No contradiction with annotations.

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

Conciseness3/5

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

The description is comprehensive but verbose, repeating 'NO STUDIO / DEV-SERVER REQUIRED' and including some details that could be streamlined. It uses bold for emphasis and front-loads the main purpose, but could be tightened without losing meaning. Adequate but not excellent in conciseness.

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?

Despite 13 parameters and a rich output schema, the description covers all essential aspects: environment dependency (playwright), mechanism check behavior, local path handling, fallback logic for base_url, and return format (images with per-view descriptions). It leaves no major gaps for an AI agent to understand what the tool does and what to expect.

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?

With 100% schema description coverage, baseline is 3. The description adds extra meaning for key parameters: explains pose format ('az,el' with rotation semantics), focus/hide semantics (mutually exclusive, same as CLI flags), and no_mechanism_check effect (ignored under strict mode). Some parameters (e.g., environment) only get minimal extra context, but overall the description significantly enriches understanding beyond the schema.

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?

The description starts with a clear verb-resource pair ('render a kernelCAD model to deterministic PNG views') and immediately differentiates from siblings by noting 'NO STUDIO / DEV-SERVER REQUIRED' and mentioning alternative tools for remote clients (open_in_studio). It explicitly states the tool's role in the evaluate→render→inspect→fix loop, making intent unambiguous.

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

Usage Guidelines4/5

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

The description explains when to use this tool (visual self-check, fast iteration) and provides context for alternatives (open_in_studio for remote clients). It covers trade-offs like skipping mechanism check for speed, but does not explicitly list scenarios where the tool should not be used. Overall, guidance is strong but slightly incomplete.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.9/5.0
Disambiguation4/5

Tools are mostly distinct, with clear descriptions for each. However, there is some potential overlap between inspection tools like 'inspect' and 'mesh_summary', and between rendering tools 'render_preview' and 'get_latest_render', which could cause minor confusion.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern, making it predictable for an agent to infer functionality.

Tool Count2/5

44 tools is significantly higher than the typical well-scoped range of 3-15. While the domain is complex, the count feels excessive and could overwhelm an agent.

Completeness4/5

The tool set covers an extensive range of CAD operations including creation, inspection, rendering, export, and verification. Minor gaps exist, such as direct sketch editing tools, but overall it is comprehensive.