Skip to main content
Glama

dedupe_materials

Merge duplicate or near-identical materials by color, texture, and properties to reduce draw calls, delete unused slots/orphans, and report removed materials and final counts.

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

TableJSON 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?

With no annotations, the description carries the full burden and does so: it discloses that users are moved to the first material, extras are deleted, repeated slots are joined, and that clean_slots/remove_orphans have destructive side effects. It even covers the edge case of an empty slot still referenced by faces (kept and reported in `faces_without_material`) and the tolerance=0 semantics.

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: the core merge behavior and its rationale come first, followed by side effects and edge cases. It is longer than typical, but nearly every clause adds a distinct behavior; minor tightening is possible 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?

No output schema exists, yet the description states what is returned (count removed, material count before/after) and names the individual counters (`empty_slots_removed`, `unused_slots_removed`, `orphans_removed`). For a destructive, no-annotation, no-output-schema tool this is complete.

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 compensate, and it explains all four parameters: `names` limits the check, `tolerance` is quantified ('0.01 means 1 percent', 'tolerance=0 merges only exact copies'), and `clean_slots`/`remove_orphans` are tied to their observable effects and output 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?

Opens with a specific verb and resource ('Merge materials that look the same') and immediately enumerates the matching criteria (colour, roughness, metallic, alpha, emission, coat, textures). An agent can distinguish this from list_materials, assign_material_faces, 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 a clear rationale and conditions for use ('Fewer materials means fewer draw calls', 'Textured and procedural materials only merge when their images and node types are the same') and constrains scope via `names`. It does not name an alternative tool or state when NOT to dedupe, so it stops 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.