Skip to main content
Glama

preflight_gcode

Validate a local G-code file against Duet/RepRapFirmware limits before upload, checking print area, temps, tools, homing, heating order, and nozzle width. Optionally write a patched copy.

Instructions

Check a local G-code file against this machine BEFORE uploading it: print area vs axis limits, temperatures vs limits, tool selection (T0), G28 in the start block, heating before extrusion, heaters off at the end, config/firmware commands, estimated line width vs nozzle. Read-only. With fixes (select-tool, strip-g28) it writes a patched copy next to the original (.duet.gcode); the original is never modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesLocal path to a .gcode / .gco / .g file
fixesNo
nozzleNoNozzle diameter in mm, to judge the line width
filamentDiameterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the exact side effect: with fixes it writes a patched copy at <name>.duet.gcode and never modifies the original. This resolves the tension between the 'Read-only' phrasing and readOnlyHint=false (a write only occurs under explicit fix options).

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-loads the purpose, then the check list, then the side-effect caveat. Dense but all sentences carry information; the long check enumeration is justified because it is the tool's actual value.

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

Completeness4/5

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

No output schema, so the description must carry the result shape, which it does loosely by listing checks. It fully covers side effects and file outputs; the only gap is filamentDiameter and per-fix semantics.

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 50%, and the description compensates by naming the concrete fix values (select-tool, strip-g28) and their file-naming side effect. It says nothing about filamentDiameter, leaving one parameter undocumented in both places.

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+resource (check a local G-code file against this machine) and enumerates the concrete checks performed. This is clearly distinguishable from the read-only machine-query siblings like get_status or list_files.

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?

Explicitly frames timing as 'BEFORE uploading it' and names the conditional fix modes. It does not state when not to use it or point to an alternative tool, so it falls short of a 5.

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