Skip to main content
Glama
fusion-cam

fusion-cam

gcode_check

Simulates material removal on posted G-code outside Fusion to flag rapids into stock, missing feeds, spindle-off moves, and tool mismatches by file and line before machining.

Instructions

Check posted G-code OUTSIDE Fusion before it goes near a machine (Fusion has no stock simulation; checkToolpath is not one). Runs in the MCP server, so Fusion is only needed to read the stock.

paths: .nc files in machining order (pass all files cam_post wrote, e.g. one per tool on Personal Use). Coordinates are WCS mm. stock_wcs_mm: [xmin, ymin, zmin, xmax, ymax, zmax]; if omitted, the stock box and the expected tool numbers are read from the Fusion setup (cam_status stock_in_wcs_mm; setup name, default the last setup). limits_wcs_mm: optional axis envelope, same format. clearance_mm: rapids below stock top + clearance inside the footprint are warned about. Simulates material removal on a height map (resolution_mm cells; tool shapes from the post's tool comments) and reports problems by file and line: RAPID_INTO_STOCK, FEED_MISSING, SPINDLE_OFF, NO_TOOL, TOOL_UNEXPECTED, H_MISMATCH, ENVELOPE, ARC_RADIUS, NO_END (errors/warnings) and BELOW_STOCK (info: normal for through holes and profiles). ok=false means do not run the program. If CAMotics is installed (camotics=true), the same programs are also simulated in CAMotics (about 10 s); camotics and simulation_comparison give both removed volumes side by side, and a SIM_DISAGREE warning is added if they differ by more than 5 %. CAMotics reports no collisions.

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": {
      "paths": "<paths>"
    },
    "name": "gcode_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsYes
setupNo
camoticsNo
clearance_mmNo
stock_wcs_mmNo
limits_wcs_mmNo
resolution_mmNo
expected_toolsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

With zero annotations the description carries the full burden and does so: it discloses that the check runs in the MCP server rather than in Fusion, describes the height-map material-removal simulation, enumerates the exact diagnostic codes emitted with their error/warning/info severity, and states the decision rule 'ok=false means do not run the program'. It also flags the important limitation that 'CAMotics reports no collisions'.

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?

The safety reason and the machine-gating rule are front-loaded, then parameters, then outputs — a sensible order with almost no filler. It is dense and slightly run-on in the simulation paragraph, but every clause (WCS units, through-hole exception for BELOW_STOCK, 5 % comparison threshold) conveys information an agent needs.

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 an 8-parameter, annotation-free verification tool this is complete: the caller learns what is simulated, where it runs, what each input means, what diagnostics come back, and what ok=false implies for downstream action. Since an output schema exists, the description is not obliged to define return shapes and instead spends its space on semantics.

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

Parameters5/5

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

Schema coverage is 0%, so the description must supply all meaning, and it does: paths is defined as .nc files in machining order including the one-file-per-tool Personal Use case, stock_wcs_mm and limits_wcs_mm are given explicit six-element [xmin…zmax] layouts, clearance_mm is defined relative to stock top and footprint, resolution_mm as height-map cell size, setup as a name defaulting to the last setup, and expected_tools as read from the Fusion setup. Only expected_tools' override behavior is left implicit.

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 ('Check posted G-code') plus a scope ('OUTSIDE Fusion'), and draws a boundary against the in-Fusion alternative ('checkToolpath is not one', Fusion has no stock simulation). No sibling in the catalog does G-code verification, and the description makes that distinction explicit.

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?

Gives clear timing guidance ('before it goes near a machine') and a precondition for the Fusion-dependent path ('Fusion is only needed to read the stock'). It also explains the optional CAMotics branch and its cost (~10 s). It does not spell out when to skip the check or when to pass explicit stock_wcs_mm versus relying on the Fusion setup, but the usage context is unambiguous.

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