Skip to main content
Glama

preview_qr_encoding

Work out how a payload will encode as a QR code, without creating anything. Returns the exact string the pixels would carry, its byte length, the QR version and module count required, the capacity remaining at that version, and any warnings. Costs nothing and mints nothing.

Use this to answer questions like "will this URL fit at error correction level H" or "how much does a long Wi-Fi password cost me in QR density". Higher ECC survives damage better but needs more modules for the same data; more modules print smaller and get harder to scan.

payloadKind 'qart_code' sizes the RETARGETABLE variant instead: the pixels carry a 16-byte qart.uk/_ link rather than your data, which is usually several versions smaller. Compare the two before committing to a print.

This returns metadata only, never the module grid. For the actual black/white matrix, call get_qr_matrix.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eccNoError correction level, lowest to highest. Defaults to the Studio default if omitted.
endNoFor 'event': end datetime.
urlNoFor payloadKind 'url': the destination.
nameNoFor payloadKind 'vcard': full name.
ssidNoFor payloadKind 'wifi': network name.
textNoFor payloadKind 'text': the literal text.
emailNoFor payloadKind 'vcard': email address.
phoneNoPhone, for vcard/mecard/tel/sms/whatsapp.
startNoFor 'event': start datetime (YYYY-MM-DDTHH:MM).
titleNoFor 'event': title. For 'vcard': job title.
allDayNoFor 'event': all-day (DATE values).
amountNoFor 'paypal': optional amount.
fieldsNoPayload fields for the kind. Flat sibling properties (url, phone, handle, …) are also accepted, matching get_qr_matrix.
handleNoFor social kinds: handle or profile URL.
messageNoFor 'sms'/'whatsapp': message text.
versionNoForce a QR version (size). Omit to use the smallest that fits.
locationNoFor 'event': location.
passwordNoFor payloadKind 'wifi': network password.
usernameNoFor 'telegram': username or t.me URL.
descriptionNoFor 'event': description.
payloadKindYesWhat the code should contain. 'qart_code' sizes the retargetable variant — a 16-byte qart.uk/_ link instead of your data. whatsapp/telegram/event/social kinds assemble a standard URL or VCALENDAR; they are verbatim, not retargetable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changed
    • addedInput schema / properties / allDay
      Added value: +{
      +  "description": "For 'event': all-day (DATE values).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / amount
      Added value: +{
      +  "description": "For 'paypal': optional amount.",
      +  "type": "string"
      +}
    • addedInput schema / properties / description
      Added value: +{
      +  "description": "For 'event': description.",
      +  "type": "string"
      +}
    • addedInput schema / properties / end
      Added value: +{
      +  "description": "For 'event': end datetime.",
      +  "type": "string"
      +}
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Payload fields for the kind. Flat sibling properties (url, phone, handle, …) are also accepted, matching get_qr_matrix.",
      +  "type": "object"
      +}
    • addedInput schema / properties / handle
      Added value: +{
      +  "description": "For social kinds: handle or profile URL.",
      +  "type": "string"
      +}
    • addedInput schema / properties / location
      Added value: +{
      +  "description": "For 'event': location.",
      +  "type": "string"
      +}
    • addedInput schema / properties / message
      Added value: +{
      +  "description": "For 'sms'/'whatsapp': message text.",
      +  "type": "string"
      +}
    • changedInput schema / properties / payloadKind / description
      Previous value: -"What the code should contain. 'qart_code' sizes the retargetable variant — a 16-byte qart.uk/_ link instead of your data."New value: +"What the code should contain. 'qart_code' sizes the retargetable variant — a 16-byte qart.uk/_ link instead of your data. whatsapp/telegram/event/social kinds assemble a standard URL or VCALENDAR; they are verbatim, not retargetable."
    • changedInput schema / properties / payloadKind / enum
      Previous value: -[
      -  "url",
      -  "qart_code",
      -  "wifi",
      -  "vcard",
      -  "text"
      -]New value: +[
      +  "url",
      +  "qart_code",
      +  "text",
      +  "wifi",
      +  "vcard",
      +  "mecard",
      +  "mailto",
      +  "tel",
      +  "sms",
      +  "geo",
      +  "whatsapp",
      +  "telegram",
      +  "event",
      +  "instagram",
      +  "twitter",
      +  "youtube",
      +  "facebook",
      +  "tiktok",
      +  "linkedin",
      +  "paypal"
      +]
    • changedInput schema / properties / phone / description
      Previous value: -"For payloadKind 'vcard': phone number."New value: +"Phone, for vcard/mecard/tel/sms/whatsapp."
    • addedInput schema / properties / start
      Added value: +{
      +  "description": "For 'event': start datetime (YYYY-MM-DDTHH:MM).",
      +  "type": "string"
      +}
    • addedInput schema / properties / title
      Added value: +{
      +  "description": "For 'event': title. For 'vcard': job title.",
      +  "type": "string"
      +}
    • addedInput schema / properties / username
      Added value: +{
      +  "description": "For 'telegram': username or t.me URL.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavior: costs nothing, mints nothing, returns metadata only, never module grid. It also explains qart_code behavior (16-byte link) and ECC/module trade-offs, far beyond minimal expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short paragraphs, front-loaded with purpose, no filler. Each sentence carries distinct info (purpose, usage, qart_code note, clarity on outputs).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 21 params and no output schema, the description enumerates the return fields (string, byte length, version, module count, capacity, warnings) and explains the tool's scope (metadata only). It also points to the sibling for the actual matrix, making it self-sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description reinforces qart_code semantics already present in schema and mentions flat sibling properties for fields, but adds little new param-level meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Work out how a payload will encode as a QR code, without creating anything', a specific verb and resource. It lists concrete outputs and explicitly contrasts with get_qr_matrix, making it distinct from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides direct usage examples ('Use this to answer questions like...') and names the alternative for actual matrix generation ('call get_qr_matrix'). It also advises comparing qart_code vs normal before printing, giving clear when-to-use context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources