Skip to main content
Glama

list_templates

Browse available image templates and their slot definitions. Filter by tags like photo, gradient, or event to find suitable templates for image generation.

Instructions

List all available image templates with their slot definitions. Use this to discover which templates exist and what slots they accept for direct rendering with generate_image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNoFilter by tag (e.g. "photo", "gradient", "event", "food", "tech")

Implementation Reference

  • The core handler: registerListTemplatesTool registers the 'list_templates' tool on the McpServer. It accepts an optional 'tag' filter, calls client.listTemplates() to fetch all templates from the API, filters by tag if provided, and formats a text response listing each template (id, description, bestFor, needsPhoto, tags, required/optional slots).
    export function registerListTemplatesTool(
      server: McpServer,
      client: RendrKitClient,
    ): void {
      server.registerTool(
        "list_templates",
        {
          description:
            "List all available image templates with their slot definitions. Use this to discover which templates exist and what slots they accept for direct rendering with generate_image.",
          inputSchema: {
            tag: z
              .string()
              .optional()
              .describe(
                'Filter by tag (e.g. "photo", "gradient", "event", "food", "tech")',
              ),
          },
        },
        async ({ tag }) => {
          try {
            const result = await client.listTemplates();
            const templates = tag
              ? result.templates.filter((t) => t.tags?.includes(tag))
              : result.templates;
    
            const lines = [
              `${templates.length} templates${tag ? ` matching tag "${tag}"` : ""} available:`,
              "",
            ];
    
            for (const t of templates) {
              const requiredSlots = t.slots
                .filter((s) => s.required)
                .map((s) => s.name);
              const optionalSlots = t.slots
                .filter((s) => !s.required)
                .map((s) => s.name);
    
              lines.push(
                `**${t.id}** — ${t.description}`,
                `  Best for: ${t.bestFor}`,
                `  Needs photo: ${t.needsPhoto}`,
                `  Tags: ${t.tags?.join(", ") || "none"}`,
                `  Required: ${requiredSlots.join(", ") || "none"}`,
                `  Optional: ${optionalSlots.join(", ") || "none"}`,
                "",
              );
            }
    
            return {
              content: [
                {
                  type: "text" as const,
                  text: lines.join("\n"),
                },
              ],
            };
          } catch (error) {
            const message =
              error instanceof Error ? error.message : String(error);
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Failed to list templates: ${message}`,
                },
              ],
              isError: true,
            };
          }
        },
      );
    }
  • Type definitions for TemplateSlot, Template, and TemplatesResponse used by the list_templates tool.
    export interface TemplateSlot {
      name: string;
      required: boolean;
      description: string;
    }
    
    /** A template definition */
    export interface Template {
      id: string;
      name: string;
      description: string;
      bestFor: string;
      needsPhoto: boolean;
      tags: string[];
      slots: TemplateSlot[];
      exampleSlots: Record<string, string>;
    }
    
    /** Response from the upload endpoint */
    export interface UploadResult {
      url: string;
      filename: string;
      size: number;
      mimeType: string;
    }
    
    /** Response from the templates endpoint */
    export interface TemplatesResponse {
      count: number;
      templates: Template[];
    }
  • src/server.ts:7-28 (registration)
    Import and registration of registerListTemplatesTool in the main server setup (line 7 import, line 22 registration call).
    import { registerListTemplatesTool } from "./tools/list-templates.js";
    import { registerUploadImageTool } from "./tools/upload-image.js";
    import { registerBatchRenderTool } from "./tools/batch-render.js";
    import { registerCloneTemplateTool } from "./tools/clone-template.js";
    
    export function createServer(client: RendrKitClient): McpServer {
      const server = new McpServer({
        name: "rendrkit",
        version: "0.3.0",
      });
    
      registerGenerateImageTool(server, client);
      registerGetImageTool(server, client);
      registerListBrandKitsTool(server, client);
      registerGetUsageTool(server, client);
      registerListTemplatesTool(server, client);
      registerUploadImageTool(server, client);
      registerBatchRenderTool(server, client);
      registerCloneTemplateTool(server, client);
    
      return server;
    }
  • The API client method listTemplates() that sends a GET request to /api/v1/templates and returns a TemplatesResponse.
    async listTemplates(): Promise<TemplatesResponse> {
      return this.request<TemplatesResponse>("GET", "/api/v1/templates");
    }
Behavior2/5

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

No annotations exist, so the description carries the full burden. It only mentions output content (templates and slot definitions) but does not disclose any behavioral traits like read-only nature, performance, or error conditions. The agent lacks info on side effects or safety.

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 wasted words. The first defines the action and result, the second provides usage context. Information is front-loaded and efficient.

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?

For a simple list tool with one optional parameter and no output schema, the description covers the purpose and usage. It doesn't mention pagination or limits, but the tool's simplicity makes it adequate.

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% with one 'tag' parameter fully described. The description adds minimal extra value beyond the schema (tying the filter to template discovery). Baseline 3 is appropriate.

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 states the tool lists all available image templates with slot definitions, using a specific verb and resource. It distinguishes itself from siblings like generate_image by focusing on discovery for rendering.

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?

It explicitly tells when to use the tool: to discover templates and their slots for direct rendering with generate_image. While it doesn't list exclusions or alternatives, the context is clear and actionable.

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