Skip to main content
Glama

validate_gcode

Read-only

Check G-code syntax and basic safety before sending, catching temperature-limit violations, firmware commands and risky moves. Preview what a printer would accept or reject.

Instructions

Validate G-code syntax and basic safety (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
        for a printer whose model Kiln does not know: temperatures are
        judged against the same floor ``set_temperature`` holds that
        printer to.
        

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

NameRequiredDescriptionDefault
commandsYesOne or more G-code commands: a newline-separated string, or a list of command strings.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / commands / description
      Added value: +"One or more G-code commands: a newline-separated string, or a list of command strings."
  2. Changed2 schema fields changedv1.5.0
    • addedInput schema / properties / commands / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / commands / type
      Removed value: -"string"
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds substantive context beyond that: it distinguishes blocking errors from non-blocking warnings, lists blocked_commands, and clarifies that printer-specific limits are deliberately out of scope while temperature floors still apply.

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 purpose and sibling exclusion are front-loaded, and the Args/Returns blocks are scannable rather than prose-heavy. It is slightly longer than necessary, but every section carries information an agent needs.

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?

There is no output schema, yet the description documents the return object's fields in detail, so return-value comprehension is covered. The only minor gap is that with no printer_id argument, the phrase about judging temperatures against 'the same floor set_temperature holds that printer to' leaves the applicable floor slightly ambiguous.

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

Parameters3/5

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

Schema description coverage is 100% and the description's Args section restates the same detail (newline-separated string or list of strings) rather than adding syntax or format nuance. With the schema carrying the parameter burden, the baseline of 3 is appropriate.

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 opening sentence names a specific verb and resource ('Validate G-code syntax and basic safety') and immediately scopes the boundary with '(no printer-specific limits)', which distinguishes it from validate_gcode_safe without requiring the schema to be opened.

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

Usage Guidelines5/5

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

It explicitly routes the agent to the alternative: 'For printer-specific safety validation (PTFE temp caps, speed limits), use validate_gcode_safe with a printer_id instead.' It also states the practical use case of previewing what send_gcode would accept or reject, covering both when-to-use and when-not-to-use.

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

Deploy Server

Other Tools