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
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient email address. | |
| subject | No | Email subject line. | |
| body | No | Email body text. | |
| cc | No | CC recipient(s). | |
| bcc | No | BCC recipient(s). | |
| label | No | Label for this QR code. | |
| format | No | Image format. | svg |
| foreground_color | No | Hex color for dots. | |
| background_color | No | Hex color for background. | |
| dot_style | No | Dot shape. | |
| corner_style | No | Corner shape. | |
| logo_url | No | Logo URL or data URI. | |
| frame_style | No | Frame style around QR. | |
| frame_text | No | CTA text on frame (max 30 chars). | |
| frame_color | No | Frame background color. | |
| frame_text_color | No | Frame text color. |
Implementation Reference
- packages/mcp/src/tools.ts:411-417 (handler)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 }, }); }, - packages/mcp/src/tools.ts:393-410 (schema)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."), }), - packages/mcp/src/server.ts:21-54 (registration)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, }; } } ); }