generate_qr
Generate a QR code from any text or URL, returning a base64-encoded image. Supports PNG and SVG formats with customizable colors.
Instructions
Generate a QR code and return it as a base64-encoded image.
Creates a QR code encoding any text or URL. Supports PNG (raster) and
SVG (vector, scales to any size). Custom foreground and background colours
allow brand-matched QR codes. Error correction level is M (~15% recovery).
Args:
url: Content to encode — can be any URL, plain text, Wi-Fi credentials
(WIFI:T:WPA;S:ssid;P:password;;), vCard, or other QR payload.
size: Output image size in pixels (default 256, range 64–2048).
Ignored for SVG format which is inherently resolution-independent.
format: Output format — 'png' (default) or 'svg'.
fg: Foreground (module) colour as hex (default '#000000').
bg: Background colour as hex (default '#ffffff').
Use '#00000000' for transparent background (PNG only).
Returns:
Base64-encoded image string (PNG bytes or SVG text, base64-encoded).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | No | #ffffff | |
| fg | No | #000000 | |
| url | Yes | ||
| size | No | ||
| format | No | png |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |