bos_customer_update
Update a customer's details such as name, phone, email, or address by providing their customer ID.
Instructions
Update customer information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | Yes | ||
| name | No | ||
| phone | No | ||
| No | |||
| address | No |
Implementation Reference
- src/tools/bos.ts:308-311 (handler)The handler function for bos_customer_update. It destructures customer_id from args, then calls client.put() to update the customer via PUT /mcp/customers/{customer_id}.
handler: async (args, client) => { const { customer_id, ...data } = args; return client.put(`/mcp/customers/${customer_id}`, data); }, - src/tools/bos.ts:301-307 (schema)The input schema for bos_customer_update. Requires customer_id (string), with optional fields: name, phone, email, address.
schema: { customer_id: { type: 'string' }, name: { type: 'string', optional: true }, phone: { type: 'string', optional: true }, email: { type: 'string', optional: true }, address: { type: 'string', optional: true }, }, - src/index.ts:54-76 (registration)Registration loop in src/index.ts that iterates all tools (including bos_customer_update) and registers them with the MCP server using server.tool(). The tool's name, description, Zod schema, and handler are passed.
// Register all tools with proper Zod schemas for (const tool of allTools) { const zodSchema = toZodSchema(tool.schema); server.tool( tool.name, tool.description, zodSchema.shape, async (args: any) => { try { const result = await tool.handler(args, client); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: JSON.stringify({ error: error.message || 'Unknown error' }) }], isError: true, }; } } ); } - src/index.ts:36-46 (registration)The customerTools array (which contains bos_customer_update) is imported from ./tools/bos.js and spread into the allTools array.
...customerTools, ...inventoryTools, ...voucherTools, ...loyaltyTools, ...storeTools, ...checkoutTools, ...promotionTools, ...engagementTools, ...erpTools, ...smartTools, ];