get_catalog_item
Retrieve specific catalog item details from the Klaviyo MCP Server using catalog ID and item ID to manage and access product information efficiently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog_id | Yes | ID of the catalog | |
| item_id | Yes | ID of the catalog item |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"catalog_id": {
"description": "ID of the catalog",
"type": "string"
},
"item_id": {
"description": "ID of the catalog item",
"type": "string"
}
},
"required": [
"catalog_id",
"item_id"
],
"type": "object"
}
Implementation Reference
- src/tools/catalogs.js:61-73 (handler)The asynchronous handler function that executes the tool logic: fetches the specified catalog item using klaviyoClient and returns JSON or error.async (params) => { try { const item = await klaviyoClient.get(`/catalogs/${params.catalog_id}/items/${params.item_id}/`); return { content: [{ type: "text", text: JSON.stringify(item, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving catalog item: ${error.message}` }], isError: true }; } },
- src/tools/catalogs.js:57-60 (schema)Zod input schema validating catalog_id and item_id parameters.{ catalog_id: z.string().describe("ID of the catalog"), item_id: z.string().describe("ID of the catalog item") },
- src/tools/catalogs.js:55-75 (registration)Direct registration of the get_catalog_item tool using server.tool, including schema, handler, and description.server.tool( "get_catalog_item", { catalog_id: z.string().describe("ID of the catalog"), item_id: z.string().describe("ID of the catalog item") }, async (params) => { try { const item = await klaviyoClient.get(`/catalogs/${params.catalog_id}/items/${params.item_id}/`); return { content: [{ type: "text", text: JSON.stringify(item, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving catalog item: ${error.message}` }], isError: true }; } }, { description: "Get a specific item from a catalog in Klaviyo" } );
- src/server.js:41-41 (registration)Top-level call to registerCatalogTools function, which registers the get_catalog_item tool (among others).registerCatalogTools(server);