get_orders_report
Generate and retrieve order reports from ShipBob's fulfillment platform by specifying date ranges and sales channels for analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | Yes | Start date for the report (YYYY-MM-DD) | |
| endDate | Yes | End date for the report (YYYY-MM-DD) | |
| channelId | No | Filter by sales channel ID |
Implementation Reference
- src/tools/reporting-tools.js:39-55 (handler)The main handler function for the 'get_orders_report' tool. It constructs parameters and calls the ShipBob API via shipbobClient, then returns a formatted text response or error.handler: async ({ startDate, endDate, channelId }) => { try { const params = { startDate, endDate, channelId }; const report = await shipbobClient.getOrdersReport(params); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving orders report: ${error.message}` }], isError: true }; } }
- src/tools/reporting-tools.js:34-38 (schema)Zod schema defining the input parameters for the tool: required startDate and endDate (YYYY-MM-DD format), optional channelId.schema: { startDate: z.string().describe("Start date for the report (YYYY-MM-DD)"), endDate: z.string().describe("End date for the report (YYYY-MM-DD)"), channelId: z.string().optional().describe("Filter by sales channel ID") },
- src/server.js:58-58 (registration)Registers the reportingTools array (containing get_orders_report) with the MCP server using the registerTools utility function.registerTools(reportingTools);
- src/api-client.js:167-169 (helper)Helper method in ShipBobClient that performs the actual API request to retrieve the orders report from ShipBob's /reports/orders endpoint.async getOrdersReport(params) { return this.request('GET', '/reports/orders', null, params); }