hold_slot
Reserve a bookable service time slot for 10 minutes while payment is processed. Use this tool to temporarily hold appointments by providing slot and cart IDs.
Instructions
Hold/reserve a session time slot for a customer. The slot is held for 10 minutes pending payment. Works for any bookable service.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slotId | Yes | The time slot ID to hold | |
| cartId | Yes | The cart ID to associate with the hold | |
| participants | No | Number of participants (default: 1) |
Implementation Reference
- src/index.ts:664-681 (handler)Handler for the 'hold_slot' tool, which sends a POST request to the W3Ship API to reserve a time slot.
case 'hold_slot': { const slotId = args?.slotId as string; const cartId = args?.cartId as string; const participants = (args?.participants as number) || 1; if (!slotId || !cartId) { return { content: [{ type: 'text', text: 'Error: slotId and cartId are required.' }], isError: true }; } const holdRes = await fetch(`${W3SHIP_API}/api/slots`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ slotId, cartId, participants }), }); const holdData = await holdRes.json(); return { content: [{ type: 'text', text: JSON.stringify(holdData, null, 2) }] }; } - src/index.ts:181-192 (schema)Registration and input schema definition for the 'hold_slot' tool.
name: 'hold_slot', description: 'Hold/reserve a session time slot for a customer. The slot is held for 10 minutes pending payment. Works for any bookable service.', inputSchema: { type: 'object', properties: { slotId: { type: 'string', description: 'The time slot ID to hold' }, cartId: { type: 'string', description: 'The cart ID to associate with the hold' }, participants: { type: 'number', description: 'Number of participants (default: 1)' }, }, required: ['slotId', 'cartId'], }, },