get_inventory_report
Retrieve detailed inventory reports from ShipBob API by specifying start and end dates, and optionally filter data by fulfillment center ID for efficient inventory management.
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:13-29 (handler)The main handler function for the 'get_inventory_report' tool, which calls the ShipBob API via shipbobClient, formats the report as JSON text content, or returns an error.handler: async ({ startDate, endDate, fulfillmentCenterId }) => { try { const params = { startDate, endDate, fulfillmentCenterId }; const report = await shipbobClient.getInventoryReport(params); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving inventory report: ${error.message}` }], isError: true }; } }
- src/tools/reporting-tools.js:8-12 (schema)Zod schema defining the input parameters: startDate, endDate, and optional fulfillmentCenterId for the get_inventory_report tool.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:5-30 (registration)The complete tool registration object for 'get_inventory_report' exported within the reportingTools array.{ name: "get_inventory_report", description: "Get inventory 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.getInventoryReport(params); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving inventory report: ${error.message}` }], isError: true }; } } },
- src/api-client.js:163-165 (helper)ShipBobClient helper method that performs the actual API GET request to '/reports/inventory' endpoint.async getInventoryReport(params) { return this.request('GET', '/reports/inventory', null, params); }
- src/tools/index.js:9-9 (registration)Re-export of reportingTools from src/tools/index.js, allowing central import of all tools including get_inventory_report.export { reportingTools } from './reporting-tools.js';