Skip to main content
Glama
Anycubic Slicer MCP

Anycubic Slicer MCP

Preview G-code

preview_gcode
Read-onlyIdempotent

Render a G-code file as a PNG to visually inspect toolpaths before printing, with top and side views plus layer-colored wall, infill, and support details.

Instructions

Draw G-code toolpaths as a PNG so you and the user can check a slice before printing.

view='top' without a layer shows placement on the bed; with a layer it colours walls orange/yellow, infill red, top surfaces pink, bottom blue, bridges cyan and support teal. view='side' shows overhangs and support. For a build-up animation use animate_layers; for a shareable summary use print_card. Read-only: returns the image and layer metadata without writing files.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath to a .gcode file on this computer, e.g. one written by slice_model.
sizeNoImage size in pixels, 200 to 2000.
viewNo'top' (from above) or 'side' (front elevation of the whole print).top
layerNo1-based layer to draw coloured by feature. Omit to draw every layer shaded by height.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.1
    • addedInput schema / properties / layer / description
      Added value: +"1-based layer to draw coloured by feature. Omit to draw every layer shaded by height."
    • addedInput schema / properties / path / description
      Added value: +"Path to a .gcode file on this computer, e.g. one written by slice_model."
    • addedInput schema / properties / size / description
      Added value: +"Image size in pixels, 200 to 2000."
    • addedInput schema / properties / view
      Added value: +{
      +  "default": "top",
      +  "description": "'top' (from above) or 'side' (front elevation of the whole print).",
      +  "title": "View",
      +  "type": "string"
      +}
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered; the description still adds value by confirming it returns an image plus layer metadata and writes no files. It also discloses what each view renders (walls/infill/top/bottom/bridges/support colours in layer mode, overhangs in side view). It says nothing about cost or limits on large G-code files, which is the only 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.

Conciseness4/5

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

Front-loaded with purpose, then rendering semantics, then alternatives and the read-only guarantee. The colour legend is dense but each clause carries information an agent cannot get from the schema; no filler sentences.

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 no output schema, the description steps in to say the tool returns the image and layer metadata. Combined with the annotation-covered safety profile and full schema coverage, an agent has everything needed to call this correctly.

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?

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema lacks: what 'top' shows with vs. without a layer, the feature colour legend keyed to the layer parameter, and that side view exposes overhangs and support. Size and path semantics are left entirely to the schema, which already documents them well.

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?

States a specific verb+resource+output: renders G-code toolpaths as a PNG, with the stated goal of checking a slice before printing. The scope is clear enough to separate it from animate_layers and print_card, which are named explicitly.

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?

Gives a positive condition (visual check before printing) and names two alternatives with the conditions that select them: animation via animate_layers, shareable summary via print_card. The agent does not have to infer routing.

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