get_product
Retrieve detailed product information by specifying a unique product ID using the ShipStation API MCP Server for efficient product management and data access.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | Yes | Product ID to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"productId": {
"description": "Product ID to retrieve",
"type": "number"
}
},
"required": [
"productId"
],
"type": "object"
}
Implementation Reference
- src/tools/product-tools.js:38-50 (handler)The handler function that executes the get_product tool logic: fetches the product details via shipStationClient.getProduct and returns formatted JSON or error response.handler: async ({ productId }) => { try { const product = await shipStationClient.getProduct(productId); return { content: [{ type: "text", text: JSON.stringify(product, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/product-tools.js:35-37 (schema)Zod schema defining the input parameter: productId as a required number.schema: { productId: z.number().describe("Product ID to retrieve") },
- src/server.js:184-191 (registration)Registration code that iterates over all tool arrays (including productTools containing get_product) and registers each tool with the MCP server using server.tool().].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:140-142 (helper)Helper method in ShipStationClient that performs the actual API GET request to retrieve product details by ID.async getProduct(productId) { return this.request('GET', `/products/${productId}`); }