get_list_layers_of_template
Retrieve a list of layers for a specific product template by providing the template ID and Shopify domain, enabling efficient management of customizable templates.
Instructions
Get list layers of template with template id and shop domain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _id | Yes | The id of the template | |
| shopDomain | Yes | The shop domain ends with .myshopify.com |
Implementation Reference
- Exports the main handler for the 'get_list_layers_of_template' tool using createHandler, which includes validation and delegates to the service method.export const getListLayersOfTemplateHandler = createHandler<GetListLayersOfTemplateArgs, any>( validateGetListLayersOfTemplateArgs, getListLayersOfTemplateServiceMethod );
- src/handlers/registrars/LayerHandlerRegistrar.ts:10-13 (registration)Registers the tool name 'get_list_layers_of_template' to the handler function in the registry.this.registry.register( TAILOR_KIT_TOOL_NAMES.GET_LIST_LAYERS_OF_TEMPLATE, (args: unknown) => getListLayersOfTemplateHandler(this.serviceManager, args) );
- Defines the MCP tool object including name, description, and input schema for 'get_list_layers_of_template'.const getListLayersOfTemplateTool: TailorKitTool = { name: TAILOR_KIT_TOOL_NAMES.GET_LIST_LAYERS_OF_TEMPLATE, description: "Get list layers of template with template id and shop domain", inputSchema: { type: "object", properties: { _id: { type: "string", description: "The id of the template", }, shopDomain: { type: "string", description: "The shop domain ends with .myshopify.com", }, ...COMMON_TOOL_PROPERTIES, }, required: ["_id", "shopDomain", "prompt", "conversationId", "conversationTitle"], }, };
- The LayerService method implementing the core logic: POST request to the API endpoint for listing layers of a template.async getListLayersOfTemplate<T = any>(args: GetListLayersOfTemplateArgs): Promise<LayerResponse<T>> { try { const data = await this.client.post<GetListLayersOfTemplateArgs, T>(API_ENDPOINTS.LAYER.GET_LIST_LAYERS_OF_TEMPLATE, args); return { data, error: null }; } catch (error) { return { data: null, error: error instanceof Error ? error : new Error(String(error)) }; } }
- types/layers.ts:8-14 (schema)TypeScript interface defining the arguments for GetListLayersOfTemplate.export interface GetListLayersOfTemplateArgs extends CommonToolArgs { /** * The id of the template */ _id: string; }