Skip to main content
Glama

dedupe_materials

Destructive

Merge duplicate materials by matching color, textures, and properties within tolerance, delete extras, join repeated mesh slots, and clean unused or orphan materials to cut draw calls.

Instructions

Merge materials that look the same: same colour, roughness, metallic, alpha, emission, coat and same textures, each within tolerance (0.01 means 1 percent). Users move to the first material of each group, the extras are deleted, and slots that now repeat inside a mesh are joined. Fewer materials means fewer draw calls. names limits the check. Returns how many were removed and the material count before and after. Textured and procedural materials only merge when their images and node types are the same. It also cleans up, on every mesh: clean_slots=true removes empty slots and slots that no face uses (empty_slots_removed, unused_slots_removed); remove_orphans=true deletes materials with zero users (orphans_removed). An empty slot that faces still point at is kept and listed in faces_without_material: assign those faces first. tolerance=0 merges only exact copies.

Input Schema

NameRequiredDescriptionDefault
namesNo
toleranceNo
clean_slotsNo
remove_orphansNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, and the description goes well beyond that: it explains that users are moved to the first material, extras deleted, repeated in-mesh slots joined, and which cleanup flags delete what (empty/unused slots, orphans). It also flags the risky edge case that empty slots still referenced by faces are kept and listed in `faces_without_material`.

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?

Dense and front-loaded with the core merge behavior before the cleanup caveats, and nearly every sentence carries distinct information. It runs long and could compress the per-flag cleanup enumeration, but nothing is filler.

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?

With no output schema, the description still reports what is returned (removed count, before/after material counts, empty_slots_removed, unused_slots_removed, orphans_removed, faces_without_material) and covers the destructive semantics that the annotations only hint at. Nothing needed to invoke it safely is missing.

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 coverage is 0%, so the description must carry the full burden, and it does: `names` limits the check, `tolerance` is explained with units and the 0.01 = 1 percent example plus the tolerance=0 special case, and clean_slots/remove_orphans are each tied to their effect and returned counters.

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?

States a specific verb and resource ('merge materials that look the same') plus the exact matching criteria (colour, roughness, metallic, alpha, emission, coat, textures). An agent can distinguish this from set_material, list_materials, and procedural_material without opening any schema.

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?

Gives clear operative conditions: `names` limits the check, `tolerance=0` merges only exact copies, and textured/procedural materials merge only when images and node types match. It never names an alternative tool or states when NOT to dedupe, so it falls short of full routing guidance.

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