update_app_store_qr
Update the app store URLs of an existing App Store QR code by providing its short ID and optionally new iOS, Android, or fallback URLs. Partial updates merge with current data without regenerating the QR image.
Instructions
Update the app store URLs of an App Store QR code. Partial updates merge with existing data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_id | Yes | The short ID of the App Store QR code to update. | |
| ios_url | No | Apple App Store URL. | |
| android_url | No | Google Play Store URL. | |
| fallback_url | No | Fallback URL. | |
| label | No | Update the label. |
Implementation Reference
- packages/mcp/src/tools.ts:651-656 (handler)Handler function that destructures input to extract short_id and label, wraps remaining fields in app_store_data, and sends a PATCH request to /api/qr/{short_id}.
handler: async (input: Record<string, unknown>) => { const { short_id, label, ...appStoreFields } = input; const body: Record<string, unknown> = { app_store_data: appStoreFields }; if (label !== undefined) body.label = label; return apiRequest(`/api/qr/${short_id}`, { method: "PATCH", body }); }, - packages/mcp/src/tools.ts:644-650 (schema)Input schema using Zod: requires short_id, optional ios_url, android_url, fallback_url, and label.
inputSchema: z.object({ short_id: z.string().describe("The short ID of the App Store QR code to update."), ios_url: z.string().optional().describe("Apple App Store URL."), android_url: z.string().optional().describe("Google Play Store URL."), fallback_url: z.string().optional().describe("Fallback URL."), label: z.string().optional().describe("Update the label."), }), - packages/mcp/src/tools.ts:641-657 (registration)Tool definition registered as a property of the `tools` object exported from tools.ts.
update_app_store_qr: { description: "Update the app store URLs of an App Store QR code. Partial updates merge with existing data.", inputSchema: z.object({ short_id: z.string().describe("The short ID of the App Store QR code to update."), ios_url: z.string().optional().describe("Apple App Store URL."), android_url: z.string().optional().describe("Google Play Store URL."), fallback_url: z.string().optional().describe("Fallback URL."), label: z.string().optional().describe("Update the label."), }), handler: async (input: Record<string, unknown>) => { const { short_id, label, ...appStoreFields } = input; const body: Record<string, unknown> = { app_store_data: appStoreFields }; if (label !== undefined) body.label = label; return apiRequest(`/api/qr/${short_id}`, { method: "PATCH", body }); }, }, - packages/mcp/src/api-client.ts:13-40 (helper)Helper function that makes HTTP requests to the backend API with X-API-Key authentication.
export async function apiRequest(path: string, options: RequestOptions = {}) { const { method = "GET", body, query } = options; let url = `${BASE_URL}${path}`; if (query) { const params = new URLSearchParams(); for (const [key, value] of Object.entries(query)) { params.set(key, String(value)); } url += `?${params.toString()}`; } const headers: Record<string, string> = { "X-API-Key": API_KEY, }; if (body) { headers["Content-Type"] = "application/json"; } const res = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined, }); return res.json(); }