create_location_qr
Generate QR codes that open geographic coordinates in map applications when scanned, allowing users to share locations with customizable visual styles.
Instructions
Create a QR code that opens a map location when scanned. Encodes geographic coordinates that map apps can parse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Geographic latitude (-90 to 90). | |
| longitude | Yes | Geographic longitude (-180 to 180). | |
| label | No | Human-readable place name (shown on map). | |
| qr_label | No | Label for this QR code (internal). | |
| 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:548-554 (handler)The handler function that creates the location QR code by calling the /api/qr endpoint.
handler: async (input: Record<string, unknown>) => { const { latitude, longitude, label, qr_label, ...rest } = input; return apiRequest("/api/qr", { method: "POST", body: { type: "location", location_data: { latitude, longitude, label }, label: qr_label, ...rest }, }); }, - packages/mcp/src/tools.ts:532-547 (schema)The input validation schema for the create_location_qr tool.
inputSchema: z.object({ latitude: z.number().min(-90).max(90).describe("Geographic latitude (-90 to 90)."), longitude: z.number().min(-180).max(180).describe("Geographic longitude (-180 to 180)."), label: z.string().optional().describe("Human-readable place name (shown on map)."), qr_label: z.string().optional().describe("Label for this QR code (internal)."), 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:529-555 (registration)Definition and registration of the create_location_qr tool.
create_location_qr: { description: "Create a QR code that opens a map location when scanned. Encodes geographic coordinates that map apps can parse.", inputSchema: z.object({ latitude: z.number().min(-90).max(90).describe("Geographic latitude (-90 to 90)."), longitude: z.number().min(-180).max(180).describe("Geographic longitude (-180 to 180)."), label: z.string().optional().describe("Human-readable place name (shown on map)."), qr_label: z.string().optional().describe("Label for this QR code (internal)."), 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 { latitude, longitude, label, qr_label, ...rest } = input; return apiRequest("/api/qr", { method: "POST", body: { type: "location", location_data: { latitude, longitude, label }, label: qr_label, ...rest }, }); }, },