Skip to main content
Glama
sellersmith

TailorKit MCP

Official
by sellersmith

create_template

Generate customizable product templates for e-commerce platforms by defining dimensions, layers, and shop domain using the TailorKit MCP server.

Instructions

Create a new template with shop domain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
_idNoThe id of the template
dimensionNoThe dimension of the template
layersNoThe layers of the template
nameYesThe name of the templateNew Template
shopDomainYesThe shop domain ends with .myshopify.com

Implementation Reference

  • The main handler function for the 'create_template' MCP tool. It uses a factory to combine argument validation and the service method that calls templateService.createTemplate(args). Includes validator (lines 8-18) and service method (23-28).
    export const createTemplateHandler = createHandler<CreateTemplateArgs, any>(
      validateCreateTemplateArgs,
      createTemplateServiceMethod
    );
  • Definition of the 'create_template' tool including name, description, and detailed JSON inputSchema for parameters like _id, shopDomain, name, dimension, layers.
    const createTemplateTool: TailorKitTool = {
      name: TAILOR_KIT_TOOL_NAMES.CREATE_TEMPLATE,
      description: "Create a new template with shop domain",
      inputSchema: {
        type: "object",
        properties: {
          _id: {
            type: "string",
            description: "The id of the template",
            pattern: UUID_PATTERN,
          },
          shopDomain: {
            type: "string",
            description: "The shop domain ends with .myshopify.com",
          },
          name: {
            type: "string",
            description: "The name of the template",
            default: "New Template",
          },
          dimension: {
            type: "object",
            description: "The dimension of the template",
            properties: {
              width: {
                type: "number",
                description: "The width of the template",
                default: 1000,
              },
              height: {
                type: "number",
                description: "The height of the template",
                default: 1000,
              },
              measurementUnit: {
                type: "string",
                description: "The measurement unit",
                default: "px",
              },
              resolution: {
                type: "number",
                description: "The resolution of the template",
                default: 300,
              },
            },
            required: ["width", "height", "measurementUnit", "resolution"],
          },
          layers: {
            type: "array",
            description: "The layers of the template",
            items: {
              type: "object",
              properties: {
                _id: {
                  type: "string",
                  description: "The id of the layer",
                  pattern: UUID_PATTERN,
                },
                label: {
                  type: "string",
                  description: "The label of the layer",
                },
                type: {
                  type: "string",
                  description: "The type of the layer",
                  enum: ["group", "text", "image", "imageless", "multi-layout"],
                },
                locked: {
                  type: "boolean",
                  description: "Whether the layer is locked",
                  default: false,
                },
                visible: {
                  type: "boolean",
                  description: "Whether the layer is visible",
                  default: true,
                },
                left: {
                  type: "number",
                  description: "The left position of the layer",
                  default: 0,
                },
                top: {
                  type: "number",
                  description: "The top position of the layer",
                  default: 0,
                },
                rotate: {
                  type: "number",
                  description: "The rotation of the layer",
                  default: 0,
                },
                width: {
                  type: "number",
                  description: "The width of the layer",
                  default: 0,
                },
                height: {
                  type: "number",
                  description: "The height of the layer",
                  default: 0,
                },
                image: {
                  type: "object",
                  description: "The image of the layer. Only used for image layer",
                  properties: {
                    src: {
                      type: "string",
                      description: "The source of the image",
                    },
                    width: {
                      type: "number",
                      description: "The width of the image",
                      default: 0,
                    },
                    height: {
                      type: "number",
                      description: "The height of the image",
                      default: 0,
                    },
                  },
                },
                children: {
                  type: "array",
                  description: "The children of the layer",
                  items: {
                    type: "string",
                  },
                },
                settings: {
                  type: "object",
                  description: "The settings of the layer",
                  properties: {},
                },
              },
              required: [
                "_id",
                "label",
                "type",
                "locked",
                "visible",
                "left",
                "top",
                "rotate",
                "width",
                "height",
              ],
            },
          },
          ...COMMON_TOOL_PROPERTIES,
        },
        required: ["_id","shopDomain", "name", "dimension", "prompt", "conversationId", "conversationTitle"],
      },
    };
    
    export default createTemplateTool;
  • Registration of the create_template tool handler in the TemplateHandlerRegistrar class.
    this.registry.register(
      TAILOR_KIT_TOOL_NAMES.CREATE_TEMPLATE,
      (args: unknown) => createTemplateHandler(this.serviceManager, args)
    );
  • TypeScript interface defining the input arguments for the create_template tool.
    export interface CreateTemplateArgs extends CommonToolArgs {
      /**
       * The id of the template
       */
      _id?: string;
      /**
       * The name of the template
       */
      name: string;
      /**
       * The dimension of the template
       */
      dimension: {
        width: number;
        height: number;
        measurementUnit: "px" | "cm" | "inch" | "mm";
        resolution: number;
      };
      /**
       * The layers of the template
       */
      layers?: Array<{
        _id: string;
        label: string;
        type: 'group' | 'text' | 'image' | 'imageless' | 'multi-layout';
        locked: boolean;
        visible: boolean;
        left: number;
        top: number;
        rotate: number;
        width: number;
        height: number;
        children?: string[];
        image?: {
          src: string;
          width: number;
          height: number;
        };
        settings?: Record<string, any>;
      }>;
    }
  • Import and inclusion of the createTemplateTool in the main tools export array.
    import createTemplateTool from "./template/createTemplateTool.js";
    import getDetailTemplateTool from "./template/getDetailTemplateTool.js";
    import getListLayersOfTemplateTool from "./layer/getListLayersOfTemplateTool.js";
    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,
      getDetailTemplateTool,
      createTemplateTool,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Create' which implies a write/mutation operation, but doesn't disclose behavioral traits like permissions needed, whether it's idempotent, error handling, or what happens on success/failure. For a creation tool with complex inputs, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. However, it's too brief given the tool's complexity—it could benefit from more context without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with 5 parameters (including nested objects), no annotations, and no output schema, the description is incomplete. It doesn't explain the template's purpose, what happens after creation, or error cases, leaving significant gaps for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value by mentioning 'shop domain' but doesn't explain parameter relationships or usage beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Create a new template') and mentions the resource ('template'), but it's vague about what a template is and doesn't differentiate from sibling tools like 'get_list_templates' or 'get_detail_template'. It mentions 'with shop domain' but doesn't explain why that matters.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'get_list_templates' for viewing templates. The description doesn't mention prerequisites, context, or exclusions, leaving the agent with no usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sellersmith/tailorkit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server