Skip to main content
Glama

generate_icon

Generate app icons, favicons, and UI elements in multiple sizes and formats from a text description.

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

  • Tool 'generate_icon' is registered in ListToolsRequestSchema handler with its name, description, and inputSchema defining parameters like prompt, sizes, type, style, format, background, corners, and preview.
    {
      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"],
      },
    },
  • The 'generate_icon' tool handler in CallToolRequestSchema: builds an icon prompt via this.buildIconPrompt(args), creates an ImageGenerationRequest, and calls this.imageGenerator.generateTextToImage().
    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;
    }
  • The buildIconPrompt helper method constructs a detailed prompt string from IconPromptArgs (prompt, type, style, background, corners) for icon generation.
    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;
    }
  • IconPromptArgs interface defines the typed input parameters used by buildIconPrompt: prompt, type, style, background, and corners.
    export interface IconPromptArgs {
      prompt?: string;
      type?: string;
      style?: string;
      background?: string;
      corners?: string;
    }
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It fails to mention key traits such as generation speed, determinism, output format handling, or any side effects. The 'preview' parameter behavior is hinted but not clearly described for the overall tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, clear sentence that captures the core functionality. However, it could be slightly more detailed without becoming verbose, e.g., listing supported formats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite 8 parameters and no output schema, the description does not explain return values or how multiple generated images are delivered. It also lacks behavior on errors or prerequisites, leaving significant gaps for an AI agent.

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 description coverage is 100%, so parameters are already documented. The description adds high-level context but does not enhance individual parameter meaning. Baseline of 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's purpose: generating specific icon types (app icons, favicons, UI elements) with explicit mention of multiple sizes and formats. It effectively differentiates from sibling tools like generate_image (general images) and generate_diagram.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context (icons and UI elements) but lacks explicit guidance on when to use this tool versus alternatives like generate_image. It does not include when-not-to-use or exclusions.

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

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