Skip to main content
Glama

clone_template

Clone a base template with your default slot values (e.g., brand name, colors) to create a reusable preset. The returned ID enables consistent future image generations.

Instructions

Clone a template with custom default values. Creates a reusable preset (e.g., your brand's product card template). Use the returned ut_ID for future generations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesBase template ID to clone
nameYesName for your custom template
default_slotsNoDefault slot values (e.g., brand name, colors)

Implementation Reference

  • Registers the 'clone_template' tool on the MCP server. Accepts template_id, name, and optional default_slots. Calls client.cloneTemplate() and returns the cloned template info including the custom ut_ID.
    export function registerCloneTemplateTool(
      server: McpServer,
      client: RendrKitClient,
    ): void {
      server.registerTool(
        "clone_template",
        {
          description:
            "Clone a template with custom default values. Creates a reusable preset (e.g., your brand's product card template). Use the returned ut_ID for future generations.",
          inputSchema: {
            template_id: z.string().describe("Base template ID to clone"),
            name: z.string().describe("Name for your custom template"),
            default_slots: z
              .record(z.string(), z.string())
              .optional()
              .describe("Default slot values (e.g., brand name, colors)"),
          },
        },
        async ({ template_id, name, default_slots }) => {
          try {
            const result = await client.cloneTemplate({
              templateId: template_id,
              name,
              defaultSlots: default_slots,
            });
    
            return {
              content: [
                {
                  type: "text" as const,
                  text: [
                    `Template cloned!`,
                    ``,
                    `Custom ID: ut_${result.id}`,
                    `Name: ${result.name}`,
                    `Base: ${result.baseTemplateId}`,
                    ``,
                    `Use "ut_${result.id}" as template_id in generate_image to use your preset.`,
                  ].join("\n"),
                },
              ],
            };
          } catch (error) {
            return {
              content: [{ type: "text" as const, text: `Clone failed: ${error instanceof Error ? error.message : String(error)}` }],
              isError: true,
            };
          }
        },
      );
    }
  • Type definition for the cloneTemplate API parameters: templateId, name, and optional defaultSlots.
    export interface CloneTemplateParams {
      templateId: string;
      name: string;
      defaultSlots?: Record<string, string>;
    }
  • Type definition for the UserTemplate response returned by cloneTemplate.
    export interface UserTemplate {
      id: string;
      baseTemplateId: string;
      name: string;
      defaultSlots: Record<string, string>;
      createdAt: string;
    }
  • API client method that posts to /api/v1/templates/clone with templateId, name, and defaultSlots to create a cloned template.
    async cloneTemplate(params: CloneTemplateParams): Promise<UserTemplate> {
      return this.request<UserTemplate>("POST", "/api/v1/templates/clone", {
        templateId: params.templateId,
        name: params.name,
        defaultSlots: params.defaultSlots,
      });
    }
  • src/server.ts:25-25 (registration)
    Registration of the clone_template tool in the MCP server setup.
    registerCloneTemplateTool(server, client);
Behavior3/5

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

No annotations exist, so the description bears the burden. It discloses the key behavioral fact that a ut_ID is returned for future use. However, it omits details on what exactly is created, side effects (e.g., does it overwrite?), or authentication/permission requirements.

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

Conciseness5/5

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

Two sentences with no redundancy. The first sentence states the core function, the second adds value with an example and usage hint. Every word earns its place.

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

Completeness4/5

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

Given the moderate complexity (3 params, nested object) and no output schema, the description adequately covers purpose, usage, and return value (ut_ID). Missing error handling or constraints, but sufficient for an agent to invoke correctly.

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 coverage is 100%, so each parameter's description is already present. The tool description adds minimal extra value (e.g., 'custom default values' maps to default_slots), but it does not elaborate on parameter constraints or formats beyond the schema.

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

Purpose5/5

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

The description clearly defines the action ('Clone a template'), the resource ('template'), and the outcome ('Creates a reusable preset') with a concrete example. It distinguishes from siblings like list_templates or generate_image by focusing on cloning and custom defaults.

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

Usage Guidelines4/5

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

The description indirectly suggests usage ('for future generations') and provides an example. However, it does not explicitly state when not to use this tool or compare to alternatives, leaving room for ambiguity.

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

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/vbiff/rendr-kit'

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