Skip to main content
Glama

get_mesh_stats

Read-only

Count faces, vertices, and triangles for all meshes under a prim to assess geometry budgets, measure simplification savings, and identify heavy subtrees for optimization.

Instructions

Count the faces, vertices and triangles of every mesh at or under a prim: the totals, then the prims under it to max_depth, each mesh with its counts and each prim above meshes with subtree_faces.

Use it for a geometry budget, what a simplification saved, or the heavy subtrees: a heavy one is the next call's prim_path. compare_prims puts two prims or variants side by side. Only UsdGeom.Mesh prims count, inside instances too, which get_scene_tree doesn't list: implicit shapes such as Cube and Sphere have no faces. Prims below max_depth aren't listed, but count in the totals and in their ancestors' subtree_faces. The totals always come inline; a tree too long to give with them goes to a file, its path in the answer.

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": {
      "prim_path": "<prim_path>"
    },
    "name": "get_mesh_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_depthNoHow many levels of the tree below prim_path to list; 0 for prim_path alone
prim_pathYesThe prim to measure, its descendant meshes included

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • addedInput schema / properties / max_depth
      Added value: +{
      +  "default": 2,
      +  "description": "How many levels of the tree below prim_path to list; 0 for prim_path alone",
      +  "minimum": 0,
      +  "title": "Max Depth",
      +  "type": "integer"
      +}
  2. First observedv0.2.2

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description adds substantial context beyond them: only UsdGeom.Mesh prims count, meshes inside instances are included, implicit shapes like Cube and Sphere have zero faces, and prims below max_depth are excluded from the listing yet still counted in totals and ancestor subtree_faces. It also discloses output behavior — totals are always inline, but an oversized tree is written to a file whose path is returned.

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 scope and purpose come first, followed by usage guidance and then caveats, so it is well ordered and every clause carries information. It is dense to the point of being a wall of prose, and a short enumerated clause list for the caveats would be easier to scan, but there is no filler to cut.

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?

An output schema exists, so return values need not be restated, yet the description still flags the file-spill path behavior that an agent must handle. Combined with the depth/counting rules and instance handling, nothing needed to invoke the tool correctly is missing.

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 the baseline would be 3, but the description adds real semantics: prim_path can be any prim and its descendants are counted, and max_depth controls what is listed versus what still contributes to totals and subtree_faces — a distinction the schema description does not make. This meaningfully clarifies the effect of the depth parameter.

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: count faces, vertices and triangles for every mesh at or under a prim, returning totals plus per-prim counts. It explicitly differentiates itself from siblings by noting that instances are not listed by get_scene_tree and that compare_prims is the side-by-side alternative.

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

Usage Guidelines5/5

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

It names three concrete use cases (geometry budget, measuring what a simplification saved, finding heavy subtrees) and tells the agent the actionable next step: a heavy prim is the next call's prim_path. It also routes the comparison use case to compare_prims, so the when/when-not boundary is explicit.

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