Skip to main content
Glama

flatten_usd_stage

Destructive

Export a flattened copy of a USD stage to .usd/.usda/.usdc/.usdz without changing the in-memory stage; use it to save a portable, provenance-tagged snapshot.

Instructions

Export a flattened copy of the stage to a .usd/.usda/.usdc/.usdz file (the file writer is chosen by the extension). Wraps UE::FUsdStage::Export(OutputPath, bAddSourceFileComment, FileFormatArguments) — does NOT alter the in-memory stage. When add_source_file_comment is true (default) the flattened file includes a comment header noting the source file (useful for provenance). The returned 'exported' field reports pxr::'s bool return — false means the file writer could not write the requested path (e.g. invalid extension, permission denied). Realistic gotcha: stage.Export() requires the stage NOT be in a restricted-edit state — under headless cov this is not an issue, but in-editor it can be during PIE.

Returns: { stage_name: string, resolution: string, output_path: string, exported: bool, add_source_file_comment: bool, errors: [string]? }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stage_nameYesName the stage was registered under, OR an absolute file path to auto-open.
output_pathYesAbsolute path of the flattened file to write. The file extension picks the writer (.usda=text, .usdc=binary, .usdz=archive).
add_source_file_commentNoInclude the source-file comment header in the flattened file (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Goes well past the annotations by disclosing a key side effect (writes to disk but leaves the in-memory stage untouched), the meaning of the 'exported' bool and its failure modes (invalid extension, permission denied), and a realistic environment gotcha (restricted-edit state during PIE). This is the kind of detail the annotations alone cannot convey.

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 purpose is front-loaded and the return shape is scoped to the end. It is dense but every sentence is relevant; the only waste is the C++-signature reference (UE::FUsdStage::Export(...)), which adds implementation noise rather than decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the inline Returns block usefully compensates by describing the response fields. The one notable gap for a destructive-hint export tool is whether an existing file at output_path is overwritten and what happens to the stage if exported is false.

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%, so the schema already documents stage_name, output_path, and add_source_file_comment. The description mostly restates these (extension picks the writer, comment header defaults to true) and adds little parameter-level meaning beyond what the schema provides, so a baseline 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 (export a flattened copy of the USD stage) plus the output formats, and immediately distinguishes itself from an in-place save by saying it 'does NOT alter the in-memory stage'. An agent can separate this from save_usd_stage without opening either schema.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: the 'does NOT alter the in-memory stage' clause hints at when this is preferable to a save, and the PIE/restricted-edit note gives a precondition. However, no sibling (save_usd_stage, export_assets, save_asset) is named and no explicit when-to-use/when-not is given.

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