Skip to main content
Glama
benswel

QR for Agent

create_qr_code

Generate customizable QR codes with dynamic URL redirection, allowing target updates without image regeneration. Customize colors, shapes, logos, and frames for branding needs.

Instructions

Create a new managed QR code with optional custom styling. The QR code points to a short URL that redirects to your target URL. You can change the target URL later without regenerating the QR image. Supports custom colors, dot shapes, corner shapes, and logo embedding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_urlYesThe destination URL the QR code should redirect to.
labelNoAn optional label to identify this QR code.
formatNoImage format. "svg" is recommended (smaller, scalable, text-parseable). Use "png" only if a bitmap is required.svg
foreground_colorNoHex color for QR code dots. Default: #000000 (black).
background_colorNoHex color for QR code background. Default: #ffffff (white).
widthNoQR code width in pixels. Default: 400.
marginNoQuiet zone margin in modules. Default: 2.
error_correctionNoError correction level. L=7%, M=15% (default), Q=25%, H=30%. Auto-set to H when logo is provided.
dot_styleNoShape of data modules. square=classic, rounded=soft corners, dots=circles, classy-rounded=organic.
corner_styleNoShape of finder patterns (corner squares). square=classic, extra-rounded=smooth, dot=circular.
logo_urlNoURL to a logo image (PNG/JPG/SVG) or data:base64 URI. Centered on the QR code.
logo_sizeNoLogo size as ratio of QR width (0.15-0.3). Default: 0.2.
gradientNoApply a gradient to QR dots and corners instead of solid foreground_color.
frame_styleNoDecorative frame around QR. 'banner_bottom': text below, 'banner_top': text above, 'rounded': rounded border with text.
frame_textNoCTA text on the frame (e.g. 'Scan Me!', 'View Menu'). Max 30 chars. Requires frame_style.
frame_colorNoHex color for frame background. Default: #000000.
frame_text_colorNoHex color for frame text. Default: #ffffff.
frame_border_radiusNoFrame corner radius. Only for 'rounded' style.
expires_atNoISO 8601 date-time. After this date, scanning returns 410 Gone instead of redirecting.
scheduled_urlNoReplacement URL that activates at scheduled_at.
scheduled_atNoISO 8601 date-time when target automatically switches to scheduled_url.
gtm_container_idNoGoogle Tag Manager container ID (e.g. 'GTM-ABC123'). Enables GTM tracking on QR scans via an intermediate HTML page.

Implementation Reference

  • The 'create_qr_code' tool definition and its handler. The handler makes a POST request to '/api/qr' using the provided input data.
    create_qr_code: {
      description:
        "Create a new managed QR code with optional custom styling. The QR code points to a short URL that redirects to your target URL. You can change the target URL later without regenerating the QR image. Supports custom colors, dot shapes, corner shapes, and logo embedding.",
      inputSchema: z.object({
        target_url: z
          .string()
          .url()
          .describe("The destination URL the QR code should redirect to."),
        label: z
          .string()
          .optional()
          .describe("An optional label to identify this QR code."),
        format: z
          .enum(["svg", "png"])
          .default("svg")
          .describe(
            'Image format. "svg" is recommended (smaller, scalable, text-parseable). Use "png" only if a bitmap is required.'
          ),
        foreground_color: z
          .string()
          .regex(/^#[0-9A-Fa-f]{6}$/)
          .optional()
          .describe("Hex color for QR code dots. Default: #000000 (black)."),
        background_color: z
          .string()
          .regex(/^#[0-9A-Fa-f]{6}$/)
          .optional()
          .describe("Hex color for QR code background. Default: #ffffff (white)."),
        width: z
          .number()
          .min(200)
          .max(2000)
          .optional()
          .describe("QR code width in pixels. Default: 400."),
        margin: z
          .number()
          .min(0)
          .max(10)
          .optional()
          .describe("Quiet zone margin in modules. Default: 2."),
        error_correction: z
          .enum(["L", "M", "Q", "H"])
          .optional()
          .describe("Error correction level. L=7%, M=15% (default), Q=25%, H=30%. Auto-set to H when logo is provided."),
        dot_style: z
          .enum(["square", "rounded", "dots", "classy-rounded"])
          .optional()
          .describe("Shape of data modules. square=classic, rounded=soft corners, dots=circles, classy-rounded=organic."),
        corner_style: z
          .enum(["square", "extra-rounded", "dot"])
          .optional()
          .describe("Shape of finder patterns (corner squares). square=classic, extra-rounded=smooth, dot=circular."),
        logo_url: z
          .string()
          .optional()
          .describe("URL to a logo image (PNG/JPG/SVG) or data:base64 URI. Centered on the QR code."),
        logo_size: z
          .number()
          .min(0.15)
          .max(0.3)
          .optional()
          .describe("Logo size as ratio of QR width (0.15-0.3). Default: 0.2."),
        gradient: z.object({
          type: z.enum(["linear", "radial"]).describe("Gradient type."),
          colors: z.array(z.string().regex(/^#[0-9A-Fa-f]{6}$/)).min(2).describe("2+ hex colors, evenly distributed."),
          angle: z.number().min(0).max(360).optional().describe("Angle in degrees (linear only). 0=left-to-right, 90=top-to-bottom."),
        }).optional().describe("Apply a gradient to QR dots and corners instead of solid foreground_color."),
        frame_style: z.enum(["none", "banner_bottom", "banner_top", "rounded"]).optional()
          .describe("Decorative frame around QR. 'banner_bottom': text below, 'banner_top': text above, 'rounded': rounded border with text."),
        frame_text: z.string().max(30).optional()
          .describe("CTA text on the frame (e.g. 'Scan Me!', 'View Menu'). Max 30 chars. Requires frame_style."),
        frame_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional()
          .describe("Hex color for frame background. Default: #000000."),
        frame_text_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional()
          .describe("Hex color for frame text. Default: #ffffff."),
        frame_border_radius: z.number().min(0).max(20).optional()
          .describe("Frame corner radius. Only for 'rounded' style."),
        expires_at: z
          .string()
          .optional()
          .describe("ISO 8601 date-time. After this date, scanning returns 410 Gone instead of redirecting."),
        scheduled_url: z
          .string()
          .url()
          .optional()
          .describe("Replacement URL that activates at scheduled_at."),
        scheduled_at: z
          .string()
          .optional()
          .describe("ISO 8601 date-time when target automatically switches to scheduled_url."),
        gtm_container_id: z
          .string()
          .regex(/^GTM-[A-Z0-9]+$/)
          .optional()
          .describe("Google Tag Manager container ID (e.g. 'GTM-ABC123'). Enables GTM tracking on QR scans via an intermediate HTML page."),
      }),
      handler: async (input: Record<string, unknown>) => {
        return apiRequest("/api/qr", { method: "POST", body: input });
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses important behavioral traits: the 'managed' nature (server-side persistence), short URL indirection mechanism, and mutability of destinations. However, it omits critical operational details like rate limits, error handling behavior, what specific data structure is returned, or required authentication/authorization levels.

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 sentences total with zero waste. Front-loaded with the core action ('Create a new managed QR code'), followed by mechanism explanation, mutability feature, and styling capabilities. Every sentence provides distinct value regarding functionality or behavior.

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

Completeness3/5

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

Given the high parameter complexity (22 params, nested objects) and 100% schema coverage, the description appropriately relies on the schema for parameter details. However, with no output schema provided, the description fails to specify what the tool returns (image data vs. JSON metadata vs. short URL), leaving a critical gap in contextual completeness.

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?

Input schema has 100% description coverage with 22 parameters, establishing a baseline of 3. The description mentions 'optional custom styling' and lists specific styling capabilities (colors, dot shapes, logo embedding) which align with parameter groups, but doesn't add semantic meaning beyond what the well-documented schema already provides.

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?

The description clearly states the tool creates a 'managed QR code' that uses a short URL redirect mechanism, distinguishing it from static QR codes. It specifies 'target URL' which differentiates it from specialized sibling tools (create_email_qr, create_phone_qr, etc.) that handle specific data types. However, it could explicitly state this is for generic web URLs versus specialized types.

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

Usage Guidelines3/5

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

The description provides one key usage guideline: 'You can change the target URL later without regenerating the QR image,' which signals when to use this over static alternatives. However, it lacks explicit guidance on when to choose this over specialized siblings (create_app_store_qr, create_vcard_qr) or prerequisites like authentication requirements.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/benswel/qr-agent-core'

If you have feedback or need assistance with the MCP directory API, please join our Discord server