Skip to main content
Glama

get_material_stats

Read-onlyIdempotent

Read per-asset shader complexity for a material or material instance, including instruction, sampler, and texture-sample counts, to inspect performance without modifying the asset.

Instructions

Read PER-ASSET shader complexity for a material or material instance (instruction counts, sampler/texture-sample counts) -- the numbers the Material Editor's Stats panel shows, unlike get_shader_info (project-wide/global). Read-only: does not Modify()/dirty the asset. Render-adjacent: forces synchronous shader compilation on the FIRST call for a given material (UMaterialEditingLibrary::GetStatistics blocks on FMaterialResource::FinishCompilation); subsequent calls are fast once the shader map is cached. Works for both UMaterial and UMaterialInstance (UMaterialInterface's GetMaterialResource is virtual/overridden on both).

Returns: { material_path, material_class, num_vertex_shader_instructions, num_pixel_shader_instructions, num_samplers, num_vertex_texture_samples, num_pixel_texture_samples, num_virtual_texture_samples, num_uv_scalars, num_interpolator_scalars, compile_errors: string[], stats_valid: bool }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
material_pathYesFull path to the material or material instance (e.g., '/Game/Materials/MyMaterial.MyMaterial')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare the safe-read profile, and the description adds real value on top: it clarifies it does not Modify()/dirty the asset, and warns that the FIRST call synchronously blocks on shader compilation (FinishCompilation) while later calls are fast once cached. This is exactly the sort of performance caveat an agent needs before invoking.

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?

Purpose and sibling contrast are front-loaded, and the returns block is well organized. A couple of sentences lean into engine internals (UMaterialEditingLibrary::GetStatistics, GetMaterialResource being virtual), which is informative but slightly heavier than strictly necessary.

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?

Although no output schema exists, the description lists the full return object including compile_errors and stats_valid, and covers applicability, side effects, and performance. Nothing an agent needs to call it correctly is missing.

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% and the single parameter (material_path) is fully documented in the schema, including an example path. The description adds no syntax or format details beyond that, so the baseline of 3 applies.

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 ('Read PER-ASSET shader complexity for a material or material instance') and enumerates the returned metrics (instruction counts, sampler/texture-sample counts). It explicitly differentiates from the sibling get_shader_info by contrasting per-asset vs project-wide/global 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?

Names the alternative (get_shader_info) and the condition that separates them (per-asset vs global), and notes it works for both UMaterial and UMaterialInstance. It stops short of explicit when-not-to-use guidance, so it is clear context rather than complete routing.

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