get_list_templates
Retrieve customizable product templates for a Shopify store by specifying domain, limit, page, sort, and filter parameters to streamline e-commerce template management.
Instructions
Get list templates with shop domain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | The filter | |
| limit | No | The limit of the templates | |
| page | No | The page number | |
| shopDomain | No | The shop domain ends with .myshopify.com | |
| sort | No | The sort order | updatedAt__desc |
Implementation Reference
- Implementation of the get_list_templates tool handler, which validates arguments and delegates to the template service's getListTemplates method./** * Validate getListTemplates arguments */ function validateGetListTemplatesArgs(args: GetListTemplatesArgs): void { validateCommonToolArgs(args); } /** * Service method for getListTemplates */ async function getListTemplatesServiceMethod( serviceManager: ServiceManager, args: GetListTemplatesArgs ) { return serviceManager.templateService.getListTemplates(args); } /** * Handler for get_list_templates tool */ export const getListTemplatesHandler = createHandler<GetListTemplatesArgs, any>( validateGetListTemplatesArgs, getListTemplatesServiceMethod );
- Input schema and metadata definition for the get_list_templates tool.const getListTemplatesTool: TailorKitTool = { name: TAILOR_KIT_TOOL_NAMES.GET_LIST_TEMPLATES, description: "Get list templates with shop domain", inputSchema: { type: "object", properties: { shopDomain: { type: "string", description: "The shop domain ends with .myshopify.com", }, limit: { type: "number", description: "The limit of the templates", default: 5, }, page: { type: "number", description: "The page number", default: 1, }, sort: { type: "string", description: "The sort order", default: "updatedAt__desc", }, filter: { type: "string", description: "The filter", format: "string__has__", }, ...COMMON_TOOL_PROPERTIES, }, required: ["shopDomain", "prompt", "conversationId", "conversationTitle"], }, };
- src/handlers/registrars/TemplateHandlerRegistrar.ts:14-17 (registration)Registration of the getListTemplatesHandler for the 'get_list_templates' tool name in the handler registry.this.registry.register( TAILOR_KIT_TOOL_NAMES.GET_LIST_TEMPLATES, (args: unknown) => getListTemplatesHandler(this.serviceManager, args) );
- src/tools/index.ts:4-10 (registration)Import and registration of the getListTemplatesTool in the main tools export.import getListTemplatesTool from "./template/getListTemplatesTool.js"; import getDetailProductTool from "./shopify/products/getDetailProductTool.js"; import { getListProductsTool } from "./shopify/products/index.js"; import getUserPreferencesTool from "./userPreferences/getUserPreferencesTool.js"; const TOOLS = [ getListTemplatesTool,
- types/templates.ts:7-31 (schema)TypeScript interface defining the shape of arguments for the get_list_templates tool.export interface GetListTemplatesArgs extends CommonToolArgs { /** * The limit of the templates * Default: 5 */ limit?: number; /** * The page number * Default: 1 */ page?: number; /** * The sort order * Default: "updatedAt__desc" */ sort?: "updatedAt__asc" | "updatedAt__desc" | "name__asc" | "name__desc"; /** * The filter name * Format: string__has__{value} */ filter?: string; }