Skip to main content
Glama

generate_icon

Create app icons, favicons, and UI elements in multiple sizes and formats from text descriptions using the Nano Banana MCP server.

Instructions

Generate app icons, favicons, and UI elements in multiple sizes and formats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the icon or UI element to generate
sizesNoArray of icon sizes in pixels (16, 32, 64, 128, 256, 512, 1024)
typeNoType of icon to generateapp-icon
styleNoVisual style of the iconmodern
formatNoOutput formatpng
backgroundNoBackground type: transparent, white, black, or color nametransparent
cornersNoCorner style for app iconsrounded
previewNoAutomatically open generated images in default viewer

Implementation Reference

  • Main execution logic for the generate_icon tool: builds a custom prompt using helper and calls the shared image generator with icon-specific parameters.
    case "generate_icon": { const prompt = this.buildIconPrompt(args); const imageRequest: ImageGenerationRequest = { prompt, outputCount: Array.isArray(args?.sizes) && args?.sizes.length > 0 ? args.sizes.length : 1, mode: "generate", preview: args?.preview as boolean, noPreview: (args?.noPreview as boolean) || (args?.["no-preview"] as boolean), }; response = await this.imageGenerator.generateTextToImage(imageRequest); break;
  • Tool registration including name, description, and detailed input schema for generate_icon.
    { name: "generate_icon", description: "Generate app icons, favicons, and UI elements in multiple sizes and formats", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Description of the icon or UI element to generate", }, sizes: { type: "array", items: { type: "number" }, description: "Array of icon sizes in pixels (16, 32, 64, 128, 256, 512, 1024)", }, type: { type: "string", enum: ["app-icon", "favicon", "ui-element"], description: "Type of icon to generate", default: "app-icon", }, style: { type: "string", enum: ["flat", "skeuomorphic", "minimal", "modern"], description: "Visual style of the icon", default: "modern", }, format: { type: "string", enum: ["png", "jpeg"], description: "Output format", default: "png", }, background: { type: "string", description: "Background type: transparent, white, black, or color name", default: "transparent", }, corners: { type: "string", enum: ["rounded", "sharp"], description: "Corner style for app icons", default: "rounded", }, preview: { type: "boolean", description: "Automatically open generated images in default viewer", default: false, }, }, required: ["prompt"], },
  • Helper method to construct the AI prompt tailored for icon generation based on input arguments.
    private buildIconPrompt(args?: IconPromptArgs): string { const basePrompt = args?.prompt || "app icon"; const type = args?.type || "app-icon"; const style = args?.style || "modern"; const background = args?.background || "transparent"; const corners = args?.corners || "rounded"; let prompt = `${basePrompt}, ${style} style ${type}`; if (type === "app-icon") { prompt += `, ${corners} corners`; } if (background !== "transparent") { prompt += `, ${background} background`; } prompt += ", clean design, high quality, professional"; return prompt;
  • TypeScript interface defining the shape of arguments for icon prompt building.
    export interface IconPromptArgs { prompt?: string; type?: string; style?: string; background?: string; corners?: string;

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/Aeven-AI/mcp-nanobanana'

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