p21
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| P21_DEVICE | No | プリンタの接続先を指定します(`-d/--device` と同等)。Windows では `rfcomm:<MAC>` または `serial:COM5`、Linux では `rfcomm:<MAC>` または `serial:/dev/rfcomm0`、macOS では `serial:/dev/cu.P21` または `ble:<UUID>`、BLE 専用の個体では `ble:<アドレス>`、実機なしで試す場合は `mock:` を指定します。 | |
| P21_TEMPLATES_DIR | No | テンプレートを保存するフォルダを指定します(クラウド同期フォルダなど)。未指定の場合は設定フォルダの `templates/` が使われます。 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| p21_label_formatA | Get the P21 label JSON format (JSON Schema) and design guidelines. Call this first. |
| p21_renderA | Render a label to a preview PNG exactly as it will print, without printing. Returns the image, warnings (fix them) and each element's box and chosen font size. |
| p21_printA | 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. |
| p21_statusB | Printer readiness, loaded label size (from the roll's RFID tag), battery and firmware. |
| p21_scanB | Search for P21 printers (paired Bluetooth Classic devices, serial ports, BLE). Takes ~5 s. |
| p21_fontsA | List installed font families usable in the |
| p21_list_templatesA | List the user's saved label templates (name, media, {{variables}}). Use one with |
| p21_save_templateA | Save a label design as a reusable template (also shown in the GUI). Put {{placeholders}} where values change. Refuses to replace an existing template unless overwrite=true. |
| p21_save_labelA | Save a label as a .p21.json file (relative paths are relative to the server's working directory) so the user can open it in the GUI or print it with the CLI. Returns the absolute path. |
| p21_load_labelA | Load a .p21.json label file. Returns the label as written in the file plus validation warnings. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool targets a clearly distinct operation: discovery (scan), readiness (status), schema guidance (label_format), assets (fonts), preview (render), output (print), and persistence (list/save template, save/load label). The only potentially confusable pair, save_template vs save_label, is clearly separated by their descriptions (reusable template with placeholders vs .p21.json file). Render vs print is also explicitly contrasted.
All tools share a consistent p21_ prefix and snake_case, which makes the set easy to scan. Most are verb_noun (render, print, scan, save_template, load_label), but a few are noun-only or noun_noun (p21_fonts, p21_status, p21_label_format), a minor deviation from the dominant pattern.
Ten tools is well-scoped for a label printer server: discovery, status, schema, fonts, preview, print, and template/file persistence. No tool appears redundant, and each covers a necessary stage of the label workflow.
The lifecycle is largely covered: find printer, check status, learn format, render, print, and save/load both templates and label files. The main gap is template management—there is no delete_template (or get-single-template) operation, so users cannot remove or inspect an individual saved template beyond listing names.