Skip to main content
Glama
benswel

QR for Agent

create_email_qr

Generate QR codes that open pre-filled emails when scanned. Set recipient, subject, body, CC, and BCC fields to simplify email communication.

Instructions

Create a QR code that opens a pre-filled email when scanned. The recipient, subject, body, CC, and BCC can all be pre-set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient email address.
subjectNoEmail subject line.
bodyNoEmail body text.
ccNoCC recipient(s).
bccNoBCC recipient(s).
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

  • The handler for `create_email_qr` sends a POST request to the `/api/qr` endpoint with type "email".
    handler: async (input: Record<string, unknown>) => {
      const { to, subject, body, cc, bcc, ...rest } = input;
      return apiRequest("/api/qr", {
        method: "POST",
        body: { type: "email", email_data: { to, subject, body, cc, bcc }, ...rest },
      });
    },
  • Zod schema definition for `create_email_qr` input validation.
    inputSchema: z.object({
      to: z.string().describe("Recipient email address."),
      subject: z.string().optional().describe("Email subject line."),
      body: z.string().optional().describe("Email body text."),
      cc: z.string().optional().describe("CC recipient(s)."),
      bcc: z.string().optional().describe("BCC recipient(s)."),
      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."),
    }),
  • Automatic registration of tools (including `create_email_qr`) into the MCP server.
    for (const [name, tool] of Object.entries(tools)) {
      server.tool(
        name,
        tool.description,
        tool.inputSchema.shape,
        async (input: Record<string, unknown>) => {
          try {
            const result = await tool.handler(input as any);
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify(result, null, 2),
                },
              ],
            };
          } catch (error) {
            const message = error instanceof Error ? error.message : String(error);
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify({
                    error: message,
                    hint: "Check the input parameters and try again. Use list_qr_codes to verify available QR codes.",
                  }),
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
Behavior3/5

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

Without annotations, the description must carry the full burden. It confirms the 'Create' mutation operation and explains the runtime behavior (opens pre-filled email when scanned), but omits persistence details, side effects, error conditions, or whether the generated code is automatically saved to an account.

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?

The description consists of two efficient sentences with zero waste: the first establishes the core purpose immediately, and the second lists the functional parameters. No redundant or filler text is present.

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?

For a tool with 16 parameters including extensive styling options (frames, colors, logos) and no output schema, the description is minimally adequate. It covers the email-specific functionality but fails to hint at the rich customization capabilities available, which an agent might need to know to utilize the tool fully.

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?

With 100% schema description coverage, the baseline is 3. The description adds semantic context by grouping the five core email parameters (to, subject, body, cc, bcc) as 'pre-set' values, but does not address the 11 styling/customization parameters (colors, frames, dot styles) that distinguish this from a basic QR generator.

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 clearly states the specific action (Create a QR code) and the distinct functionality (opens a pre-filled email when scanned), effectively differentiating it from siblings like create_sms_qr or create_phone_qr through the email-specific use case.

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 lists which email fields can be pre-set (recipient, subject, body, CC, BCC), implying the tool is for generating email composition QR codes. However, it lacks explicit guidance on when to choose this over the generic create_qr_code or other specialized variants.

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