list_brand_kits
Retrieve saved brand kits containing colors, fonts, and logos to maintain visual consistency across generated images.
Instructions
List all saved brand kits. Brand kits contain colors, fonts, and logos for consistent image generation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/list-brand-kits.ts:4-62 (handler)Main tool implementation: registerListBrandKitsTool function that registers the 'list_brand_kits' tool with the MCP server, including the async handler logic that fetches brand kits from the API and formats the response.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:1-29 (registration)Server registration: The list_brand_kits tool is registered in the createServer function at line 20 by calling registerListBrandKitsTool(server, client).import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RendrKitClient } from "./api-client.js"; import { registerGenerateImageTool } from "./tools/generate-image.js"; import { registerGetImageTool } from "./tools/get-image.js"; 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/types.ts:27-35 (schema)Type definition: BrandKit interface defines the structure of brand kit objects with id, name, colors array, optional font and logoUrl, and timestamps.export interface BrandKit { id: string; name: string; colors: string[]; font?: string; logoUrl?: string; createdAt: string; updatedAt: string; }
- src/api-client.ts:101-103 (helper)API client method: listBrandKits method that makes a GET request to /api/v1/brand-kits endpoint to retrieve all brand kits.async listBrandKits(): Promise<BrandKit[]> { return this.request<BrandKit[]>("GET", "/api/v1/brand-kits"); }