rr_get_po_documents
Retrieve documents attached to a purchase order for inventory management and order tracking.
Instructions
List documents attached to a PO
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| po_id | Yes |
Implementation Reference
- src/index.ts:86-99 (handler)The CallToolRequestSchema handler in main() genericizes tool execution by passing the tool name to the callApi helper function, which then calls the backend API endpoint.
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:37-37 (registration)Tool 'rr_get_po_documents' is registered in the TOOLS array with its input schema.
{ name: 'rr_get_po_documents', description: 'List documents attached to a PO', inputSchema: { type: 'object' as const, properties: { po_id: { type: 'string' } }, required: ['po_id'] } },