get_shipping_report
Generate detailed shipping reports from the ShipBob API by specifying date ranges and fulfillment center IDs for targeted logistics analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | Yes | End date for the report (YYYY-MM-DD) | |
| fulfillmentCenterId | No | Filter by fulfillment center ID | |
| startDate | Yes | Start date for the report (YYYY-MM-DD) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"endDate": {
"description": "End date for the report (YYYY-MM-DD)",
"type": "string"
},
"fulfillmentCenterId": {
"description": "Filter by fulfillment center ID",
"type": "string"
},
"startDate": {
"description": "Start date for the report (YYYY-MM-DD)",
"type": "string"
}
},
"required": [
"startDate",
"endDate"
],
"type": "object"
}
Implementation Reference
- src/tools/reporting-tools.js:65-81 (handler)The main handler function for the 'get_shipping_report' MCP tool. It constructs parameters from input, calls the ShipBob API via shipbobClient, formats the report as JSON text response, 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)Zod schema defining the input parameters for the get_shipping_report tool: required startDate and endDate (YYYY-MM-DD format), 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 tool definition object (registration in the reportingTools array), which includes name, description, schema, and handler. This array is later registered in the MCP server.{ 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/server.js:58-58 (registration)Call to registerTools(reportingTools) in the MCP server setup, which iterates over the tools array and registers each tool using server.tool(name, schema, handler).registerTools(reportingTools);
- src/api-client.js:171-173 (helper)Helper method in ShipBobClient class that performs the actual API request to ShipBob's /reports/shipping endpoint, used by the tool handler.async getShippingReport(params) { return this.request('GET', '/reports/shipping', null, params); }