toolkit-mcp-server: generate QR code
toolkit_generate_qrTurn any text or URL into a QR code. Get output as SVG markup, base64 PNG, or terminal-renderable characters with adjustable error correction and size.
Instructions
Encode text or a URL into a QR code. data is the content to encode (a link, a generated identifier such as toolkit_generate_id's ids[0], or any string). format selects the output: svg returns inline SVG markup, png_base64 returns base64-encoded PNG bytes (with mimeType and byteLength), and terminal returns a block of Unicode block characters renderable in a monospace terminal. errorCorrection (L/M/Q/H) trades data capacity for damage tolerance, margin sets the quiet-zone width, and scale sets pixels per module for raster output. The returned version (1–40) reflects how dense the encoded data is. png_base64 renders (modules + 2 × margin) × scale pixels per side and rejects anything past 2048 px with a typed raster_too_large error, so a dense symbol needs a lower scale; svg carries no such limit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The text or URL to encode. 2953 is the absolute ceiling (QR version 40, level L, byte mode); usable capacity drops at higher errorCorrection levels, so over-capacity data is rejected with a typed data_too_large error rather than a generic failure. | |
| scale | No | Pixels per module for raster (png_base64) output. Ignored for terminal. png_base64 also bounds the whole image at 2048 px per side, so a dense symbol or a wide margin admits a lower scale than 32. | |
| format | No | Output format: svg markup, png_base64 (raster bytes), or a terminal-renderable string. | svg |
| margin | No | Quiet-zone width in modules around the symbol. The spec recommends 4. | |
| errorCorrection | No | Error-correction level: L (~7% recoverable) to H (~30%). Higher tolerance lowers data capacity. | M |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| format | No | The format that was produced. | |
| content | No | The QR artifact: SVG markup, a terminal-renderable string, or base64 PNG bytes for png_base64. | |
| version | No | QR symbol version (1–40); higher versions hold denser data and indicate denser content. | |
| mimeType | No | MIME type of content for image formats. Absent for the terminal format. | |
| byteLength | No | Decoded byte size of the PNG. Present only for png_base64. |