Skip to main content
Glama

analyze_print_file

Read-only

Extracts slicer metadata from a G-code file on your 3D printer—including material, print time, temperatures, layer height, and filament use—so you can identify what a meaningless filename will print.

Instructions

Analyze a G-code file on the printer and extract its metadata.

Reads the file header to extract slicer-embedded metadata such as
material type, estimated print time, temperatures, layer height,
and filament usage.  This is especially useful when filenames are
meaningless (e.g. ``test5112.gcode``) and the agent needs to
understand what a file will print.

.. note::
    For multi-object .gcode.3mf files, also consider using
    ``list_plate_objects()`` to see individual objects on the plate.

Args:
    filename: Name or path of the file as shown by ``printer_files()``.

Returns a JSON object with:
- ``filename``: the file name
- ``metadata``: extracted metadata (material, time, temps, slicer, etc.)
- ``has_metadata``: whether any metadata was found

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": {
      "filename": "<filename>"
    },
    "name": "analyze_print_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesName or path of the file as shown by ``printer_files()``.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / filename / description
      Added value: +"Name or path of the file as shown by ``printer_files()``."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered. The description adds real behavior: it reads only the header rather than parsing the whole file, and it exposes has_metadata so the agent knows absence of metadata is a normal outcome rather than an error. It does not mention error behavior for missing/invalid filenames.

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 is front-loaded in the first sentence, and the note and Returns list are informative rather than filler. The Args block merely restates the schema, which is mild redundancy, and the RST docstring formatting is heavier than necessary.

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?

With no output schema, the description compensates by enumerating the returned fields (filename, metadata, has_metadata). Combined with the header-only read behavior, an agent has enough to call it and interpret the result; only failure modes and file-type coverage (.3mf vs .gcode) are left implicit.

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?

The single parameter has 100% schema description coverage, and the description's Args entry repeats the schema text verbatim rather than adding constraints such as whether subdirectories or absolute paths are accepted. The one added value is the cross-reference to printer_files() as the source of valid names, so it sits at the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Analyze a G-code file on the printer and extract its metadata') and enumerates the metadata classes (material, print time, temperatures, layer height, filament usage). It does not distinguish itself from the very similar-looking sibling 'extract_file_metadata', which keeps it out of the top band.

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 a concrete usage context ('especially useful when filenames are meaningless, e.g. test5112.gcode') and names one alternative, list_plate_objects(), for multi-object .gcode.3mf files. It offers no exclusion relative to extract_file_metadata or printer_files, so the routing guidance is helpful but incomplete.

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