get_detail_template
Retrieve detailed product template information using template ID and shop domain to manage customizable templates on Shopify via TailorKit MCP server.
Instructions
Get detail 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
- Handler for get_detail_template tool that validates args and delegates to template service.export const getDetailTemplateHandler = createHandler<GetTemplateArgs, any>( validateGetDetailTemplateArgs, getDetailTemplateServiceMethod );
- Tool schema definition including input schema, name, and description for get_detail_template.const getDetailTemplateTool: TailorKitTool = { name: TAILOR_KIT_TOOL_NAMES.GET_DETAIL_TEMPLATE, description: "Get detail 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"], }, };
- src/handlers/registrars/TemplateHandlerRegistrar.ts:19-22 (registration)Registration of the get_detail_template tool handler in the TemplateHandlerRegistrar.this.registry.register( TAILOR_KIT_TOOL_NAMES.GET_DETAIL_TEMPLATE, (args: unknown) => getDetailTemplateHandler(this.serviceManager, args) );
- Complete implementation block for the get_detail_template handler, including validation, service method, and handler creation.function validateGetDetailTemplateArgs(args: GetTemplateArgs): void { if (!args._id) { throw new Error("Invalid arguments: _id is required"); } validateCommonToolArgs(args); } /** * Service method for getDetailTemplate */ async function getDetailTemplateServiceMethod( serviceManager: ServiceManager, args: GetTemplateArgs ) { return serviceManager.templateService.getDetailTemplate(args); } /** * Handler for get_detail_template tool */ export const getDetailTemplateHandler = createHandler<GetTemplateArgs, any>( validateGetDetailTemplateArgs, getDetailTemplateServiceMethod );
- Service method called by the handler to fetch the detail template via API POST request.async getDetailTemplate<T = any>(args: GetTemplateArgs): Promise<TemplateResponse<T>> { try { const data = await this.client.post<GetTemplateArgs, T>(API_ENDPOINTS.TEMPLATE.GET_DETAIL_TEMPLATE, args); return { data, error: null }; } catch (error) { return { data: null, error: error instanceof Error ? error : new Error(String(error)) }; }