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
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Plain text content to encode. | |
| 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:520-526 (handler)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 }, }); }, - packages/mcp/src/tools.ts:506-519 (schema)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."), }), - packages/mcp/src/tools.ts:503-527 (registration)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 }, }); }, },