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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions generating patterns and textures but doesn't describe key behaviors: whether this is a read-only or mutating operation, what the output format is (e.g., image file, URL), any rate limits, authentication needs, or side effects. For a tool with 8 parameters and no annotations, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Generate seamless patterns and textures for backgrounds and design elements.' It's front-loaded with the core purpose, has zero waste, and is appropriately sized for the tool's complexity. Every word earns its place by specifying the action, output, and use cases.

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?

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is incomplete. It lacks information on behavioral traits (e.g., output format, side effects), usage guidelines relative to siblings, and doesn't address the absence of an output schema. For a generative tool with multiple parameters, more context is needed to help an agent use it effectively.

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 the schema already documents all 8 parameters thoroughly with descriptions, enums, and defaults. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain how 'prompt' interacts with 'style' or 'density'). Baseline 3 is appropriate when the schema does the heavy lifting, but the description doesn't compensate with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Generate seamless patterns and textures for backgrounds and design elements.' It specifies the verb ('Generate') and resource ('patterns and textures'), and mentions the intended use cases ('backgrounds and design elements'). However, it doesn't explicitly differentiate from sibling tools like 'generate_image' or 'generate_icon', which might also produce visual outputs.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or specify contexts where this tool is preferred over others (e.g., 'generate_image' for general images vs. this for patterns). Usage is implied by the purpose but lacks explicit when/when-not instructions or named alternatives.

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