Label Compile
label_compileCompile label definitions into printer commands (TSC, ZPL, EPL) by submitting width, language, and elements for thermal label printing.
Instructions
Label Compile. Compile a label to printer commands (tsc, zpl, epl, …). POST width, language, and elements. Text uses content and size (1-10), not text or fontSize. No barcode element. Example: {"width":40,"height":30,"unit":"mm","language":"zpl","element… Credit cost: 3 credits per call.
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": {
"width": "<width>",
"elements": "<elements>",
"language": "<language>"
},
"name": "label_compile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | Printer DPI. Default 203. | |
| gap | No | Gap between labels in mm. Ignored for receipts. | |
| unit | No | Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots. Allowed values: mm, inch, dot. Default: "mm". | |
| speed | No | Print speed, 1-18. | |
| width | Yes | Label width. Required. Default unit is mm. Example: 40. Do not send query instead of width. | |
| copies | No | Number of copies. Minimum 1. | |
| fields | No | Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost. | |
| height | No | Label height in the same unit. Example: 30. Omit for receipt / continuous mode. | |
| density | No | Print darkness, 0-15. | |
| printer | No | Printer profile id (tsc-te210, zebra-zd420, …). | |
| elements | Yes | Required array. Text items need type=text, content, and size (1-10 magnification). Do not use text, fontSize, or type=barcode. Positions x/y are in dots. Example item: {"type":"text","content":"Order: 1042","x":10,"y":10,"size":2}. | |
| language | Yes | Required printer language. Example: zpl or tsc. Do not omit. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, escpos, starprnt, ipl. Default: "tsc". | |
| direction | No | Print direction. 0 = normal, 1 = reversed. Default: 1. |