validate_gcode
Validate G-code syntax and basic safety before sending, returning blocking errors, warnings, and blocked commands so you can preview what will be accepted or rejected.
Instructions
Validate G-code syntax and basic safety (generic, no printer-specific limits).
For printer-specific safety validation (PTFE temp caps, speed limits),
use ``validate_gcode_safe`` with a ``printer_id`` instead.
Args:
commands: One or more G-code commands: a newline-separated
string, or a list of command strings.
Returns a JSON object with:
- ``valid``: whether all commands passed safety checks
- ``commands``: the parsed command list
- ``errors``: blocking issues (temperature limits, firmware commands)
- ``warnings``: non-blocking advisories (Z below bed, high feedrate)
- ``blocked_commands``: specific commands that were blocked
Use this to preview what ``send_gcode`` would accept or reject.
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": {
"commands": "<commands>"
},
"name": "validate_gcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commands | Yes | One or more G-code commands: a newline-separated string, or a list of command strings. |