list_products
Retrieve and filter product data from ShipBob's e-commerce fulfillment API using pagination and search terms for efficient product management.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of products per page | |
| page | No | Page number for pagination | |
| search | No | Search term to filter products |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"limit": {
"description": "Number of products per page",
"type": "number"
},
"page": {
"description": "Page number for pagination",
"type": "number"
},
"search": {
"description": "Search term to filter products",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tools/product-tools.js:13-29 (handler)The handler function for the 'list_products' tool. It accepts optional page, limit, and search parameters, calls shipbobClient.getProducts, and returns the products as JSON-formatted text or an error message.handler: async ({ page, limit, search }) => { try { const params = { page, limit, search }; const products = await shipbobClient.getProducts(params); return { content: [{ type: "text", text: JSON.stringify(products, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing products: ${error.message}` }], isError: true }; } }
- src/tools/product-tools.js:8-12 (schema)Input schema for the 'list_products' tool using Zod, defining optional pagination and search parameters.schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of products per page"), search: z.string().optional().describe("Search term to filter products") },
- src/server.js:50-50 (registration)Registration of the productTools array (including 'list_products') to the MCP server via the registerTools utility function.registerTools(productTools);