Skip to main content
Glama

Convert image to ZPL

image_to_zpl
Read-onlyIdempotent

Convert an image (PNG, JPEG, BMP, GIF or SVG, max 200 KB) to a ZPL ^GF graphic command. SVG is rasterised at the chosen density from its declared size (mm/in honoured); SVGs with external references or a DTD are rejected. Returns the ZPL plus measured dimensions and the physical print size at the chosen density. PDF input is REST-only (/v1/graphics).

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": {
      "image_base64": "<image_base64>"
    },
    "name": "image_to_zpl"
  }
}

Input Schema

NameRequiredDescriptionDefault
dpmmNoTarget printer density
wrapNoWrap the ^GF in a printable ^XA...^XZ label with ^PW/^LL
ditherNoDither instead of hard threshold (photos)
image_base64YesBase64-encoded image bytes. A data:image/...;base64, prefix and line breaks are accepted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / image_base64 / description
      Previous value: -"Base64-encoded image bytes"New value: +"Base64-encoded image bytes. A data:image/...;base64, prefix and line breaks are accepted."
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, so the bar is lower. The description adds meaningful traits beyond them: the 200 KB limit, SVG rejection rules, and that it returns the ZPL plus measured dimensions and physical print size — useful since there is no output schema.

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 the core action and constraints, then edge-case caveats (SVG, PDF). Dense but every sentence carries information; the SVG sentence is long but not redundant.

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 naming the return payload (ZPL, measured dimensions, physical print size), and it covers size limits and input restrictions. Minor gap: no explicit pagination/error behavior or comparison to sibling image tools, though those are less relevant here.

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. The description adds relational meaning the schema lacks — that density drives SVG rasterisation and determines the reported physical print size — which helps an agent reason about the dpmm parameter beyond its enum definition.

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 and resource (convert image → ZPL ^GF graphic command) and enumerates accepted input formats plus a size cap. It is clearly distinguishable from siblings like convert_zpl_dpi or zpl_preview, which operate on ZPL rather than producing it from raster input.

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 real routing context: PDF input is excluded and redirected to the REST endpoint /v1/graphics, and SVG inputs with external refs or a DTD are rejected. It does not explicitly compare against siblings such as barcode_png (image → ?) or zpl_preview, so the alternative-selection guidance is incomplete but clear for the main edge cases.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.