update_qr_destination
Change where an existing QR code redirects without regenerating the image. Update campaigns, fix broken links, or run A/B tests by modifying the destination URL.
Instructions
Change where an existing QR code redirects to. This is the key 'dynamic link' feature: the QR image stays the same, but scanning it will now go to the new URL. Ideal for updating campaigns, fixing broken links, or A/B testing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_id | Yes | The short ID of the QR code to update. | |
| target_url | Yes | The new destination URL. | |
| label | No | Optionally update the label too. | |
| expires_at | No | ISO 8601 expiration date. Set to null to remove expiration. | |
| scheduled_url | No | Scheduled replacement URL. Set to null to cancel. | |
| scheduled_at | No | ISO 8601 activation date for scheduled_url. Set to null to cancel. | |
| gtm_container_id | No | Google Tag Manager container ID. Set to null to remove GTM tracking. |
Implementation Reference
- packages/mcp/src/tools.ts:157-167 (handler)The handler function for 'update_qr_destination' performs a PATCH request to the API with the provided QR code details.
handler: async (input: { short_id: string; target_url: string; label?: string; expires_at?: string | null; scheduled_url?: string | null; scheduled_at?: string | null; gtm_container_id?: string | null }) => { const body: Record<string, unknown> = { target_url: input.target_url, label: input.label }; if (input.expires_at !== undefined) body.expires_at = input.expires_at; if (input.scheduled_url !== undefined) body.scheduled_url = input.scheduled_url; if (input.scheduled_at !== undefined) body.scheduled_at = input.scheduled_at; if (input.gtm_container_id !== undefined) body.gtm_container_id = input.gtm_container_id; return apiRequest(`/api/qr/${input.short_id}`, { method: "PATCH", body, }); }, - packages/mcp/src/tools.ts:124-156 (schema)Input schema for 'update_qr_destination' using Zod for validation.
inputSchema: z.object({ short_id: z.string().describe("The short ID of the QR code to update."), target_url: z .string() .url() .describe("The new destination URL."), label: z .string() .optional() .describe("Optionally update the label too."), expires_at: z .string() .nullable() .optional() .describe("ISO 8601 expiration date. Set to null to remove expiration."), scheduled_url: z .string() .url() .nullable() .optional() .describe("Scheduled replacement URL. Set to null to cancel."), scheduled_at: z .string() .nullable() .optional() .describe("ISO 8601 activation date for scheduled_url. Set to null to cancel."), gtm_container_id: z .string() .regex(/^GTM-[A-Z0-9]+$/) .nullable() .optional() .describe("Google Tag Manager container ID. Set to null to remove GTM tracking."), }), - packages/mcp/src/tools.ts:121-121 (registration)Registration of the 'update_qr_destination' tool in the tools object.
update_qr_destination: {