Skip to main content
Glama

validate_gcode

Validate G-code syntax and basic safety, returning parsed commands, errors, warnings, and blocked commands to preview what send_gcode would accept or reject.

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 separated by newlines.

        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.
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandsYes
Behavior4/5

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

Describes return format (JSON with valid, commands, errors, warnings, blocked_commands) and states it performs generic safety checks. No annotations provided, but description adequately covers behavior for a validation tool. Could mention if it has side effects (likely none), but that's implied.

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

Conciseness5/5

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

Two clear paragraphs: first explains purpose and sibling differentiation, second details parameters and return values. Every sentence adds value, no redundancy.

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?

With only one parameter and no output schema, the description fully explains what the tool does, what input it expects, what output it produces, and how it relates to other tools (send_gcode, validate_gcode_safe). Complete for its complexity.

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?

Input schema has 0% description coverage, but description explains the single parameter 'commands' as G-code commands separated by newlines, adding meaning beyond the schema type string.

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?

Clearly states it validates G-code syntax and basic safety, and distinguishes from sister tool validate_gcode_safe for printer-specific validation. The verb 'validate' and resource 'G-code' are specific.

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?

Explicitly says use for generic validation, and for printer-specific safety use validate_gcode_safe. Also advises to preview what send_gcode would accept/reject, providing clear usage context and alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codeofaxel/kiln'

If you have feedback or need assistance with the MCP directory API, please join our Discord server