Skip to main content
Glama
prusaslicer-mcp
by sebastienc

preview_gcode

Read-onlyIdempotent

Render sliced G-code as layer or profile images to verify what will actually print. Use profile view to spot floating parts or empty height bands before trusting slice statistics.

Instructions

Draw a picture of sliced G-code, to check what will really be printed before trusting the statistics.

Use view=profile after slice_model: it shows at a glance if parts of the print float or whole stretches of the height are empty. Use view=layer to inspect one layer's perimeters, infill and supports.

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": {
      "gcode_path": "<gcode_path>"
    },
    "name": "preview_gcode"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoPicture width and height in pixels
viewNolayer (default): one layer's toolpaths coloured by feature, with the layer below as a faint ghost. profile: front and side silhouettes of everything printed, where a stretch of height with nothing printed shows as a blank band.layer
layerNoLayer number for view=layer, from 1 (the first layer); default the middle layer
gcode_pathYesAbsolute path to a text G-code file, such as the gcode_path slice_model returns

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and openWorldHint=false, so safety is covered; the description adds real value by explaining what each view reveals (a blank band means unprinted height, a faint ghost is the layer below). It does not state the concrete return form (image bytes vs. a written file path) or cost/time for large models, which is the main remaining gap.

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?

Three tight sentences: the purpose and the motivation come first, then one sentence per view mode. There is no filler, and each sentence carries distinct decision-relevant information.

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 four well-documented parameters, no output schema, and annotations covering the safety profile, the description covers the decision-relevant behavior well. The one omission is what the caller actually receives (an inline image, a file on disk, or a path), which matters for chaining into a report.

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 schema already explains view, layer and size in detail, so the baseline applies. The description reinforces the meaning of view=profile and view=layer in terms of what the agent should look for, but says nothing about the layer or size parameters, so it adds interpretation rather than new parameter semantics.

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?

"Draw a picture of sliced G-code" gives a concrete verb and a precise resource, and the stated goal ("check what will really be printed before trusting the statistics") makes clear it is a visual verification tool, not a slicer or a model previewer. The two view modes further pin down the scope, so an agent can separate it from slice_model and preview_model without opening the schema.

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?

It gives explicit sequencing ("Use view=profile after slice_model") and states the condition that selects each mode: profile to detect floating parts or empty height bands, layer to inspect perimeters, infill and supports. It stops short of saying when not to use it or how it relates to preview_model/inspect_model, so it is strong context without full routing guidance.

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