Skip to main content
Glama

Generate a QR code

generate_qr_code

Encodes text or URLs into QR codes, returning an image or a 0/1 text matrix. Set size, colors, padding, and error correction for your needs.

Instructions

Encodes text or a URL as a QR code. Returns a link to the image and the image itself. With the text format it returns the code as rows of 0 and 1 instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoPixels per QR module, from `1` to `20`.
colorNoForeground colour as six hex digits, for example `ff6700`, or a decimal RGB integer. Default black.000000
formatNo`png` (default), `jpg`, `svg`, or `text` for a 0/1 matrix in JSON.png
bgcolorNoBackground colour as six hex digits, for example `ff6700`, or a decimal RGB integer. Default white.FFFFFF
contentYesThe text or URL to encode, up to 4000 characters.
paddingNoQuiet zone around the code in modules, 0 to 20. Default 2.
accuracyNoError-correction level. Higher levels survive more damage but produce denser codes.normal

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

With annotations only covering safety/idempotency hints, the description carries useful extra weight by disclosing the return shape: a link to the image, the image itself, or a 0/1 row matrix in text format. It does not mention determinism or any rate/size limits, but the output disclosure is genuinely valuable given there is no output schema.

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?

Three short sentences with zero filler, and the core purpose is front-loaded before the return-value detail. Every sentence earns its place.

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

Completeness4/5

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

For a simple generation tool with full schema coverage and no output schema, the description supplies the essential return-value information an agent needs. The main omission is any routing guidance relative to sibling generation tools.

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 description coverage is 100%, so all seven parameters (size, color, bgcolor, padding, accuracy, format, content) are fully documented in the schema itself. The description only echoes the text-format behavior already stated in the format enum, adding little beyond the baseline.

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

Purpose4/5

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

States a specific verb and resource ("Encodes text or a URL as a QR code") and specifies the two output shapes, which clearly separates it from read_qr_code and is distinguishable from generate_barcode by name. It never names a sibling explicitly, so it falls short of the top band.

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

Usage Guidelines2/5

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

No guidance on when to choose this over generate_barcode or read_qr_code, and no mention of prerequisites or limits beyond the schema. Usage must be inferred entirely from the name and parameter set.

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