get_work_orders
Retrieve work orders from manufacturing systems with filtering options by status or production order ID to manage maintenance tasks and operations.
Instructions
Get work orders from MES system. Can filter by status or production order.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter by work order status | |
| productionOrderId | No | Filter by production order ID |
Implementation Reference
- src/index.ts:584-607 (handler)The handleGetWorkOrders function implements the core logic for the 'get_work_orders' tool, filtering mock data based on input arguments.
private handleGetWorkOrders(args: { status?: string; productionOrderId?: string; }) { let orders = [...mockWorkOrders]; if (args.productionOrderId) { orders = orders.filter( (o) => o.productionOrderId === args.productionOrderId ); } if (args.status) { orders = orders.filter((o) => o.status === args.status); } return { content: [ { type: "text", text: JSON.stringify(orders, null, 2), }, ], }; } - src/index.ts:84-102 (registration)The 'get_work_orders' tool registration within the ListToolsRequestSchema handler.
{ name: "get_work_orders", description: "Get work orders from MES system. Can filter by status or production order.", inputSchema: { type: "object", properties: { status: { type: "string", enum: ["pending", "in-progress", "completed", "on-hold"], description: "Filter by work order status", }, productionOrderId: { type: "string", description: "Filter by production order ID", }, }, }, },