rr_create_purchase_order
Create draft purchase orders for inventory replenishment by specifying vendor details, items, quantities, and delivery dates.
Instructions
Create a draft purchase order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vendor_id | Yes | ||
| po_number | No | ||
| notes | No | ||
| expected_delivery_date | No | ||
| items | No |
Implementation Reference
- src/index.ts:86-100 (handler)The handler logic for all tools, including rr_create_purchase_order, which delegates the call to the central `callApi` function.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await callApi(name, (args as Record<string, unknown>) || {}); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true, }; } }); - src/index.ts:47-47 (schema)Schema definition for rr_create_purchase_order.
{ name: 'rr_create_purchase_order', description: 'Create a draft purchase order', inputSchema: { type: 'object' as const, properties: { vendor_id: { type: 'string' }, po_number: { type: 'string' }, notes: { type: 'string' }, expected_delivery_date: { type: 'string' }, items: { type: 'array', items: { type: 'object', properties: { sku: { type: 'string' }, quantity: { type: 'number' }, unit_cost: { type: 'number' } } } } }, required: ['vendor_id'] } },