Print on the P21
p21_printPrints labels on a Nelko P21 thermal printer, including batch rows and saved templates; run after verifying the design with p21_render.
Instructions
Print a label on the Nelko P21. This uses real labels: call it only when the user asked to print, with 1 copy unless told otherwise, after checking p21_render. rows prints one label per item. With device mock: the result contains mock_png, the image the simulated printer received.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "p21_print"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Batch: one label per item | |
| text | No | Shortcut: a plain text label (auto-sized, bold) instead of `label`. Use `\n` for line breaks. | |
| label | No | Nelko P21 label. Coordinates are printer dots (203 dpi, ~8 dots/mm) on the design canvas. Landscape 14x40 mm canvas = 284 x 96 dots (x across the label length, y across the 12 mm printable tape width). Canvas width = round(length_mm * 7.1) for other lengths. Output is pure black/white. | |
| media | No | Label roll size for `text` (ignored with `label`) | 14x40 |
| copies | No | ||
| device | No | Printer spec, e.g. ble:AA:BB:CC:DD:EE:FF, rfcomm:AA:BB:CC:DD:EE:FF, serial:COM5, mock: (simulated). Omit to use the server's default. | |
| density | No | Darkness (default 15) | |
| template | No | Name of a saved template (see p21_list_templates) instead of `label`; fill its {{variables}} with `variables`/`rows` | |
| variables | No | Values for {{name}} placeholders |