list_brand_kits
List stored brand kits with colors, fonts, and logos to maintain visual consistency in generated images.
Instructions
List all saved brand kits. Brand kits contain colors, fonts, and logos for consistent image generation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/list-brand-kits.ts:4-62 (handler)The main handler function for the 'list_brand_kits' tool. Registers the tool on the MCP server, calls client.listBrandKits() to fetch brand kits, formats the result as a text response listing each kit's name, ID, colors, font, and logo URL, and handles errors.
export function registerListBrandKitsTool( server: McpServer, client: RendrKitClient, ): void { server.registerTool( "list_brand_kits", { description: "List all saved brand kits. Brand kits contain colors, fonts, and logos for consistent image generation.", }, async () => { try { const brandKits = await client.listBrandKits(); if (brandKits.length === 0) { return { content: [ { type: "text" as const, text: "No brand kits found. Create one at https://rendrkit.dev to ensure consistent branding in your generated images.", }, ], }; } const kitDescriptions = brandKits.map((kit) => { const lines = [ `- ${kit.name} (ID: ${kit.id})`, ` Colors: ${kit.colors.join(", ")}`, ]; if (kit.font) lines.push(` Font: ${kit.font}`); if (kit.logoUrl) lines.push(` Logo: ${kit.logoUrl}`); return lines.join("\n"); }); return { content: [ { type: "text" as const, text: `Brand Kits (${brandKits.length}):\n\n${kitDescriptions.join("\n\n")}`, }, ], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Failed to list brand kits: ${message}`, }, ], isError: true, }; } }, ); } - src/server.ts:5-28 (registration)Registration of the list_brand_kits tool on line 5 (import) and line 20 (call to registerListBrandKitsTool).
import { registerListBrandKitsTool } from "./tools/list-brand-kits.js"; import { registerGetUsageTool } from "./tools/get-usage.js"; 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; } - src/api-client.ts:101-103 (helper)The API client helper method 'listBrandKits' that makes the HTTP GET request to /api/v1/brand-kits to fetch brand kits from the backend.
async listBrandKits(): Promise<BrandKit[]> { return this.request<BrandKit[]>("GET", "/api/v1/brand-kits"); } - src/types.ts:27-35 (schema)The BrandKit interface/type definition used for the tool's return data, containing fields: id, name, colors, font?, logoUrl?, createdAt, updatedAt.
export interface BrandKit { id: string; name: string; colors: string[]; font?: string; logoUrl?: string; createdAt: string; updatedAt: string; }