get_shipping_report
Generate shipping reports from ShipBob's fulfillment API by specifying date ranges and optional fulfillment center filters to track delivery performance.
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) | |
| fulfillmentCenterId | No | Filter by fulfillment center ID |
Implementation Reference
- src/tools/reporting-tools.js:65-81 (handler)The main handler function for the 'get_shipping_report' tool. It constructs parameters, calls the ShipBob API via shipbobClient, formats the report as JSON, or returns an error message.handler: async ({ startDate, endDate, fulfillmentCenterId }) => { try { const params = { startDate, endDate, fulfillmentCenterId }; const report = await shipbobClient.getShippingReport(params); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving shipping report: ${error.message}` }], isError: true }; } }
- src/tools/reporting-tools.js:60-64 (schema)Input schema using Zod for validating parameters: required startDate and endDate (YYYY-MM-DD), optional fulfillmentCenterId.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)"), fulfillmentCenterId: z.string().optional().describe("Filter by fulfillment center ID") },
- src/tools/reporting-tools.js:57-82 (registration)The complete tool definition object for 'get_shipping_report', including name, description, schema, and handler, added to the reportingTools array.{ name: "get_shipping_report", description: "Get shipping report from ShipBob", 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)"), fulfillmentCenterId: z.string().optional().describe("Filter by fulfillment center ID") }, handler: async ({ startDate, endDate, fulfillmentCenterId }) => { try { const params = { startDate, endDate, fulfillmentCenterId }; const report = await shipbobClient.getShippingReport(params); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving shipping report: ${error.message}` }], isError: true }; } } }
- src/api-client.js:171-173 (helper)Helper method in ShipBobClient that makes the API request to '/reports/shipping' endpoint, called by the tool handler.async getShippingReport(params) { return this.request('GET', '/reports/shipping', null, params); }
- src/server.js:58-58 (registration)Registration call that adds all reporting tools, including 'get_shipping_report', to the MCP server via the generic registerTools function.registerTools(reportingTools);