rr_send_purchase_order
Send approved purchase orders to suppliers to manage inventory replenishment and prevent stockouts.
Instructions
Send an approved PO to the supplier
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| po_id | Yes |
Implementation Reference
- src/index.ts:57-70 (handler)The 'callApi' function serves as the central handler for executing MCP tools. It forwards the tool name and arguments to a remote API endpoint.
async function callApi(toolName: string, input: Record<string, unknown>): Promise<unknown> { const resp = await fetch(`${BASE_URL}/api/mcp/call`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${API_KEY}`, }, body: JSON.stringify({ tool: toolName, input }), }); if (!resp.ok) { const errorBody = await resp.text(); throw new Error(`API error ${resp.status}: ${errorBody}`); } - src/index.ts:51-51 (registration)The tool 'rr_send_purchase_order' is registered in the TOOLS constant definition within src/index.ts.
{ name: 'rr_send_purchase_order', description: 'Send an approved PO to the supplier', inputSchema: { type: 'object' as const, properties: { po_id: { type: 'string' } }, required: ['po_id'] } },