Skip to main content
Glama

set_mesh_material_id

DestructiveIdempotent

Writes a MaterialID to all or selected triangles of a DynamicMeshActor's live mesh, enabling material assignment for later static mesh conversion.

Instructions

Stamp a MaterialID onto triangles of a DynamicMeshActor's live dynamic mesh. scope='all' repaints every triangle (UGeometryScriptLibrary_MeshMaterialFunctions::ClearMaterialIDs); scope='triangles' repaints the listed triangle IDs (SetMaterialIDOnTriangles). Calls EnableMaterialIDs first, because on a mesh without that attribute the engine drops the write. An ID in triangle_ids that is not a triangle, or an empty mesh, is an error checked before anything is painted. The targeted triangles are read back: applied is true when all of them carry material_id, and the call fails otherwise.

Returns: { actor_name, material_id, scope, triangles_targeted: int, triangles_painted: int, max_material_id_after: int, distinct_material_ids_after: int, applied: bool }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNo'all' (default) or 'triangles'.
actor_nameYesLabel or name of the target DynamicMeshActor.
material_idNoMaterialID to write (>= 0). Index into the material list later passed to copy_dynamic_mesh_to_static_mesh.
triangle_idsNoRequired when scope='triangles': array of triangle IDs to repaint (e.g. from select_mesh_triangles).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructive/readOnly/idempotent, and the description adds substantial behavioral detail beyond them: EnableMaterialIDs is invoked first because the engine otherwise drops the write, errors are validated before anything is painted, and targeted triangles are read back to confirm applied. This is exactly the mutation-mechanics context an agent needs.

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?

Front-loaded with the core action, then prerequisites, then error conditions, then the return shape. Each sentence carries distinct information with no restatement of the name or schema.

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 spells out the full return object (including applied and max/distinct_material_ids_after), and it covers the error and prerequisite behavior. An agent has everything needed to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is a 3, but the description adds meaning beyond the schema by mapping each scope value to an underlying engine call (ClearMaterialIDs vs SetMaterialIDOnTriangles) and noting material_id is an index for later copy_dynamic_mesh_to_static_mesh.

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?

The description opens with a precise verb+resource: 'Stamp a MaterialID onto triangles of a DynamicMeshActor's live dynamic mesh.' The scope semantics ('all' repaints every triangle vs 'triangles' repaints the listed IDs) effectively separate it from the region- and polygroup-based siblings like set_mesh_material_id_in_region and set_polygroup_material_id.

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 states the condition selecting each mode ('scope=triangles' requires triangle_ids) and the prerequisite that EnableMaterialIDs is called first. It stops short of explicitly routing the agent to alternative tools (e.g. when to prefer set_mesh_material_id_in_region over this one).

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

Deploy Server

Other Tools