Skip to main content
Glama

generate_material

Generate tileable PBR surface materials from a text prompt, reference image, or existing image, including base color, height, normal, roughness, and AO maps.

Instructions

Make a tileable (seamless) PBR surface material for environment art: rock, rusted metal, floors.

prompt describes the surface only ("rough grey basalt rock with cracks"); "seamless top-down texture" wording is added. size 1024 (default) or 2048 (512 to 2048, a multiple of 64). reference_image: a picture whose colours and material to follow (FLUX.2 Klein). tile_image: make this existing image tileable instead of generating one (the prompt still guides the seam repaint). How it tiles: the image is offset by half its size with wrap around, then the cross where the old edges meet is repainted image to image under a soft, ragged mask (Z-Image Turbo) and only the masked part composited back; the arms stop short of the edges and the leftover spots are repainted after a further quarter offset, so no repaint ever crosses an edge and the result wraps exactly. seam_width (0.05 to 0.3 of the size, default 0.25) is how wide the band is; seam_denoise (0.3 to 1.0, default 0.7) how freely it is repainted: higher hides a stubborn seam but drifts from the surrounding texture. The wrap and the repainted centre are then measured; while the centre still shows a line, the repaint runs again (seam_passes in all, default 2; a rerun is kept only if it helps). Maps, derived from the base color in Blender on the CPU, all tiling: height (16 bit; luminance, high pass, light blur; brighter is higher, invert_height=True for the reverse), normal (tangent space, OpenGL +Y green up as Unity and Blender expect; directx_normal=True writes DirectX -Y for Unreal; normal_strength 0 to 10), roughness (roughness 0 to 1 is the base, 0.2 glossy, 0.8 matte; rougher in cavities and dark spots by up to roughness_variation), ambient occlusion from the height's cavities (ao_strength 0 to 1). Previews: a 3x3 tiling of the base color, and a lit Cycles render (preview "sphere", "plane" or "none") using every map. Look at both to judge seams and relief. Output: <output_dir or /ai/output/localgen/material/>/_/ with _basecolor.png, _height.png, _normal_gl.png (or _normal_dx.png), _roughness.png, _ao.png, _tile3x3.png, _preview.png. Returns the paths, seed, the normal convention, and seam metrics per map ("tiles" is true when every wrap edge is within the image's own neighbouring pixel differences). About 25 s on the GPU at 1024 when warm (longer at 2048, and again for each extra seam pass), plus 5 to 15 s in Blender on the CPU.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generate_material"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
seedNo
sizeNo
promptYes
previewNosphere
roughnessNo
output_dirNo
seam_widthNo
tile_imageNo
ao_strengthNo
seam_passesNo
seam_denoiseNo
invert_heightNo
directx_normalNo
normal_strengthNo
reference_imageNo
roughness_variationNo
idle_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses the exact wrap-and-repaint algorithm, that a rerun is kept only if it improves metrics, that maps are CPU-derived in Blender, the runtime split (~25 s GPU + 5–15 s CPU, longer at 2048 or per extra pass), and the filesystem write target. This is far beyond what a bare 'generate' would convey.

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?

The purpose is front-loaded and nearly every sentence carries information the agent needs, but the multi-sentence 'How it tiles' walkthrough of masks, quarter offsets, and repaint order is more internal detail than an invocation decision requires, and the whole block is unstructured prose rather than scannable bullets. Slightly overlong for what it changes about calling behavior.

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

Completeness5/5

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

For an 18-parameter, no-output-schema tool this is essentially complete: output directory layout, every emitted file, what the return payload contains (paths, seed, normal convention, per-map seam metrics, the "tiles" flag), and expected latency are all stated. An agent can call this correctly and set expectations without opening the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must supply all meaning, and it does for 17 of 18 parameters: size bounds (512–2048, multiple of 64), seam_width/seam_denoise ranges with a trade-off explanation, seam_passes, normal_strength and roughness/roughness_variation ranges, ao_strength, preview enum values, output_dir default pattern, and the name/seed path convention. Only idle_timeout_seconds goes unexplained, which is a negligible gap.

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?

"Make a tileable (seamless) PBR surface material for environment art: rock, rusted metal, floors" gives a specific verb, a specific artifact, and concrete example domains. It is unmistakably distinct from generate_image (single image) and texture_mesh (applying to a mesh), and the enumeration of derived maps confirms the scope.

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

Usage Guidelines4/5

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

It clearly separates the two invocation modes (prompt-driven generation vs. tile_image repaint), tells the agent what to put in the prompt and what wording is auto-appended, and gives conditional guidance for invert_height and directx_normal (Unreal vs. Unity/Blender). It never names a sibling alternative or states when not to use this tool, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.