update_vcard_qr
Update contact details in an existing vCard QR code without regenerating the image. Modify name, organization, email, phone, or other fields; changes apply directly to the QR.
Instructions
Update the contact details of a vCard QR code. Only works on QR codes created with type='vcard'. Partial updates merge with existing data. Note: updating vCard data changes the QR image content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_id | Yes | The short ID of the vCard QR code to update. | |
| first_name | No | Contact first name. | |
| last_name | No | Contact last name. | |
| organization | No | Company or organization. | |
| title | No | Job title. | |
| No | Email address. | ||
| phone | No | Phone number. | |
| url | No | Website URL. | |
| address | No | Street address. | |
| note | No | Additional notes. | |
| label | No | Update the label. |
Implementation Reference
- packages/mcp/src/tools.ts:363-368 (handler)The handler function for 'update_vcard_qr' that extracts short_id, label, and vcard fields, then sends a PATCH request to /api/qr/{short_id}.
handler: async (input: Record<string, unknown>) => { const { short_id, label, ...vcardFields } = input; const body: Record<string, unknown> = { vcard_data: vcardFields }; if (label !== undefined) body.label = label; return apiRequest(`/api/qr/${short_id}`, { method: "PATCH", body }); }, - packages/mcp/src/tools.ts:348-361 (schema)Input schema definition for update_vcard_qr using Zod. Describes the tool and validates short_id (required), plus optional vCard fields (first_name, last_name, organization, title, email, phone, url, address, note) and label.
description: "Update the contact details of a vCard QR code. Only works on QR codes created with type='vcard'. Partial updates merge with existing data. Note: updating vCard data changes the QR image content.", inputSchema: z.object({ short_id: z.string().describe("The short ID of the vCard QR code to update."), first_name: z.string().optional().describe("Contact first name."), last_name: z.string().optional().describe("Contact last name."), organization: z.string().optional().describe("Company or organization."), title: z.string().optional().describe("Job title."), email: z.string().optional().describe("Email address."), phone: z.string().optional().describe("Phone number."), url: z.string().optional().describe("Website URL."), address: z.string().optional().describe("Street address."), note: z.string().optional().describe("Additional notes."), label: z.string().optional().describe("Update the label."), - packages/mcp/src/server.ts:21-53 (registration)Registration of all tools (including update_vcard_qr) into the McpServer. Each tool from tools.ts is registered with its name, description, inputSchema, and handler via server.tool().
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, }; } } );