Skip to main content
Glama

generate_pattern

Create seamless patterns and textures for backgrounds and design elements using customizable parameters like style, density, and color schemes.

Instructions

Generate seamless patterns and textures for backgrounds and design elements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the pattern or texture to generate
sizeNoPattern tile size (e.g., "256x256", "512x512")256x256
typeNoType of pattern to generateseamless
styleNoPattern styleabstract
densityNoElement density in the patternmedium
colorsNoColor schemecolorful
repeatNoTiling method for seamless patternstile
previewNoAutomatically open generated images in default viewer

Implementation Reference

  • Executes the generate_pattern tool by building a specialized prompt and invoking the shared image generation service.
    case "generate_pattern": { const prompt = this.buildPatternPrompt(args); const imageRequest: ImageGenerationRequest = { prompt, outputCount: 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; }
  • Defines the tool schema including input parameters for the generate_pattern tool, used for both registration and validation.
    { name: "generate_pattern", description: "Generate seamless patterns and textures for backgrounds and design elements", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Description of the pattern or texture to generate", }, size: { type: "string", description: 'Pattern tile size (e.g., "256x256", "512x512")', default: "256x256", }, type: { type: "string", enum: ["seamless", "texture", "wallpaper"], description: "Type of pattern to generate", default: "seamless", }, style: { type: "string", enum: ["geometric", "organic", "abstract", "floral", "tech"], description: "Pattern style", default: "abstract", }, density: { type: "string", enum: ["sparse", "medium", "dense"], description: "Element density in the pattern", default: "medium", }, colors: { type: "string", enum: ["mono", "duotone", "colorful"], description: "Color scheme", default: "colorful", }, repeat: { type: "string", enum: ["tile", "mirror"], description: "Tiling method for seamless patterns", default: "tile", }, preview: { type: "boolean", description: "Automatically open generated images in default viewer", default: false, }, }, required: ["prompt"], }, },
  • Constructs the detailed text prompt for pattern generation by combining user arguments with defaults and pattern-specific descriptors.
    private buildPatternPrompt(args?: PatternPromptArgs): string { const basePrompt = args?.prompt || "abstract pattern"; const type = args?.type || "seamless"; const style = args?.style || "abstract"; const density = args?.density || "medium"; const colors = args?.colors || "colorful"; const size = args?.size || "256x256"; let prompt = `${basePrompt}, ${style} style ${type} pattern, ${density} density, ${colors} colors`; if (type === "seamless") { prompt += ", tileable, repeating pattern"; } prompt += `, ${size} tile size, high quality`; return prompt; }
  • TypeScript interface matching the input schema for pattern prompt arguments.
    export interface PatternPromptArgs { prompt?: string; type?: string; style?: string; density?: string; colors?: string; size?: 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