@kinetixarts/server-craft-it
Version:
Craft IT - Model Context Protocol (MCP) compliant Server for AI-Powered Asset Generation using Gemini
65 lines • 2.27 kB
JavaScript
/**
* Register all prompts with the MCP server
* @param server The FastMCP server instance
*/
export function registerPrompts(server) {
// generate prompt
server.addPrompt({
name: "generate_asset",
description: "Prompt template for generating an asset (image/icon) with parameters.",
arguments: [
{
name: "prompt",
description: "Textual description of the asset.",
required: true,
},
{
name: "primary_color",
description: "Hex code or color name.",
required: false,
},
{
name: "style_descriptor",
description: "Style descriptor, e.g., 'flat', 'minimalist'.",
required: false,
},
{
name: "format",
description: "Output format: 'png' or 'jpg'.",
required: true,
enum: ["png", "jpg"],
},
{
name: "width",
description: "Width in pixels (64-1024).",
required: false,
},
{
name: "height",
description: "Height in pixels (64-1024).",
required: false,
},
],
load: async (args) => {
const { prompt, primary_color, style_descriptor, format, width, height } = args;
// Build a comprehensive prompt string that includes all parameters
let promptString = prompt;
// Add style information if provided
if (style_descriptor) {
promptString += ` in a ${style_descriptor} style`;
}
// Add color information if provided
if (primary_color) {
promptString += ` with ${primary_color} as the primary color`;
}
// Add size information if provided
if (width && height) {
promptString += ` at ${width}x${height} pixels`;
}
// Add format preference
promptString += ` in ${format} format`;
return promptString;
}
});
}
//# sourceMappingURL=prompts.js.map