Skip to main content
Glama

flatten_usd

Destructive

Flatten a USD stage into one file by resolving references, payloads, and sublayers, so you can hand the entire scene to another tool as a single USD file.

Instructions

Write a stage flattened into one USD file: its references, payloads and sublayers resolved into a single layer.

Use it to hand the whole scene to another tool as one file; save_scene keeps the references and writes only the root layer, and export_prim_as_file writes one prim's subtree. Leave input_path empty for the open stage, or name a USD file: one the open stage has loaded, its own file included, is flattened as Kit holds it, unsaved edits too, and the open stage is left as it is; one USD can't open is an error. output_path is overwritten, but one the open stage has loaded (its own file, a sublayer, a referenced or payload file) is an error, since writing it would replace a file the open scene is made of: name another path, or save the open stage with save_scene. Textures and other files the stage points at are not copied.

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": {
      "output_path": "<output_path>"
    },
    "name": "flatten_usd"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_pathNoThe USD file to flatten, on Kit's machine; the open stage, unsaved edits too, when empty
output_pathYesThe USD file to write, on Kit's machine; overwritten if there, but never one the open stage has loaded

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.3
    • changedInput schema / properties / input_path / description
      Previous value: -"The USD file to flatten; the open stage when empty"New value: +"The USD file to flatten, on Kit's machine; the open stage, unsaved edits too, when empty"
    • changedInput schema / properties / output_path / description
      Previous value: -"The flattened USD file to write"New value: +"The USD file to write, on Kit's machine; overwritten if there, but never one the open stage has loaded"
  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 flag destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: it says exactly what gets overwritten, what constitutes a forbidden overwrite (own file, sublayer, referenced or payload file), that unsaved edits are included, that the open stage is left untouched, that an unopenable USD is an error, and that textures are not copied. That is unusually rich disclosure for a mutation tool.

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 is front-loaded in the first sentence, followed by alternatives and then the error semantics, which is the right ordering. Some clauses are run-on and grammatically rough ("one USD can't open is an error") and a few rules restate the schema, costing a little tightness.

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 no explanation; what an agent still needs — input resolution rules, overwrite safety, error conditions, and the side effects on the open stage — is all covered. Nothing material is missing for a correct call.

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 is 3; the description earns an extra point by spelling out the consequences of each parameter choice (empty input_path = open stage including unsaved edits; output_path overwrite vs. error). It overlaps noticeably with the schema's own parameter descriptions rather than adding genuinely new syntax or format detail.

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 ("Write a stage flattened into one USD file") and immediately explains what flattening means: references, payloads and sublayers resolved into a single layer. It explicitly distinguishes itself from the two sibling tools that could be confused with it (save_scene, export_prim_as_file), so an agent can route correctly without opening schemas.

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?

Gives an explicit use case ("hand the whole scene to another tool as one file") plus named alternatives with their differing behavior: save_scene keeps references and writes only the root layer, export_prim_as_file writes one prim's subtree. It also states when-not: an output_path the open stage has loaded is an error, with the remedy (name another path, or use save_scene).

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