Skip to main content
Glama
benswel

QR for Agent

create_text_qr

Generate QR codes containing plain text messages, notes, or freeform content that displays directly when scanned, with customization options for appearance and format.

Instructions

Create a QR code that contains plain text. When scanned, the text is displayed directly. Useful for messages, notes, or any freeform content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesPlain text content to encode.
labelNoLabel for this QR code.
formatNoImage format.svg
foreground_colorNoHex color for dots.
background_colorNoHex color for background.
dot_styleNoDot shape.
corner_styleNoCorner shape.
logo_urlNoLogo URL or data URI.
frame_styleNoFrame style around QR.
frame_textNoCTA text on frame (max 30 chars).
frame_colorNoFrame background color.
frame_text_colorNoFrame text color.

Implementation Reference

  • Handler function that executes the create_text_qr tool logic by calling the /api/qr endpoint.
    handler: async (input: Record<string, unknown>) => {
      const { content, ...rest } = input;
      return apiRequest("/api/qr", {
        method: "POST",
        body: { type: "text", text_data: { content }, ...rest },
      });
    },
  • Input schema validation for the create_text_qr tool.
    inputSchema: z.object({
      content: z.string().describe("Plain text content to encode."),
      label: z.string().optional().describe("Label for this QR code."),
      format: z.enum(["svg", "png"]).default("svg").describe("Image format."),
      foreground_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for dots."),
      background_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for background."),
      dot_style: z.enum(["square", "rounded", "dots", "classy-rounded"]).optional().describe("Dot shape."),
      corner_style: z.enum(["square", "extra-rounded", "dot"]).optional().describe("Corner shape."),
      logo_url: z.string().optional().describe("Logo URL or data URI."),
      frame_style: z.enum(["none", "banner_bottom", "banner_top", "rounded"]).optional().describe("Frame style around QR."),
      frame_text: z.string().max(30).optional().describe("CTA text on frame (max 30 chars)."),
      frame_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame background color."),
      frame_text_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame text color."),
    }),
  • Tool definition and registration for create_text_qr within the tools object in packages/mcp/src/tools.ts.
    create_text_qr: {
      description:
        "Create a QR code that contains plain text. When scanned, the text is displayed directly. Useful for messages, notes, or any freeform content.",
      inputSchema: z.object({
        content: z.string().describe("Plain text content to encode."),
        label: z.string().optional().describe("Label for this QR code."),
        format: z.enum(["svg", "png"]).default("svg").describe("Image format."),
        foreground_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for dots."),
        background_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for background."),
        dot_style: z.enum(["square", "rounded", "dots", "classy-rounded"]).optional().describe("Dot shape."),
        corner_style: z.enum(["square", "extra-rounded", "dot"]).optional().describe("Corner shape."),
        logo_url: z.string().optional().describe("Logo URL or data URI."),
        frame_style: z.enum(["none", "banner_bottom", "banner_top", "rounded"]).optional().describe("Frame style around QR."),
        frame_text: z.string().max(30).optional().describe("CTA text on frame (max 30 chars)."),
        frame_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame background color."),
        frame_text_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame text color."),
      }),
      handler: async (input: Record<string, unknown>) => {
        const { content, ...rest } = input;
        return apiRequest("/api/qr", {
          method: "POST",
          body: { type: "text", text_data: { content }, ...rest },
        });
      },
    },
Behavior3/5

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

With no annotations provided, the description must carry full behavioral burden. It successfully explains the runtime behavior ('When scanned, the text is displayed directly'), but lacks details on output format, whether the QR is persisted to the platform (given list/delete siblings exist), rate limits, or authentication requirements.

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?

Two sentences totaling 22 words. First sentence defines the action and resource; second explains behavior and use cases. Zero redundancy — every word earns its place with information density appropriate for the tool complexity.

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 12 parameters with rich styling options and a complex QR management ecosystem (evidenced by analytics, webhooks, and bulk operation siblings), the description is minimally sufficient for invocation but omits whether the created QR is persisted, managed, or just returned as data. No output schema exists to compensate.

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%, establishing a baseline of 3. The description mentions 'plain text' which aligns with the 'content' parameter, but adds no syntax details, validation rules, or usage guidance beyond what the schema already provides for the 12 parameters.

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 explicitly states 'Create a QR code that contains plain text' — specific verb (Create), resource (QR code), and content type (plain text). It effectively distinguishes from siblings like create_email_qr or create_wifi_qr by specifying the text content type.

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

Usage Guidelines4/5

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

Provides clear positive guidance ('Useful for messages, notes, or any freeform content') and explains the scanning behavior ('text is displayed directly'). Implicitly differentiates from actionable QR siblings (email, phone, etc.) by emphasizing static text display, though it doesn't explicitly name alternatives.

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