Skip to main content
Glama
luckynee

Unity Prefab Parser MCP Server

by luckynee

parse_unity_file

Parse Unity text-serialized files to extract only Inspector-visible component data in compact YAML, resolving asset references and reducing token usage.

Instructions

Parse a Unity text-serialized prefab, scene, or asset file and extract Inspector-visible component data in YAML format.

WORKFLOW: For best results with asset name resolution, call init_unity_project first. If already initialized, the cache is loaded automatically.

Automatically resolves asset names from GUIDs by scanning the project's .meta files (or using the initialized cache). Outputs a clean, hierarchical structure showing the GameObject tree and all component data.

IMPORTANT: Fields not shown in output have their default values or are null references.

  • Transform: lPos (0,0,0), lRot (0,0,0,1), lScale (1,1,1) are omitted when default

  • Null references and unresolved GUIDs are omitted

  • enabled:true is omitted (only enabled:false is shown)

Features:

  • Resolves script, material, sprite, and other asset references to human-readable names

  • Filters out Unity internal fields (m_ObjectHideFlags, serializedVersion, etc.)

  • Renames fields to match Unity Inspector names (m_LocalPosition -> localPosition)

  • Supports configurable detail levels: minimal, standard, or compact

  • Prefab Variant Support:

    • Auto-detects prefab variants and nested prefab instances

    • Shows variant_of field with base prefab name

    • Groups all modifications under base prefab name

    • Merges Vector3 properties (x, y, z -> single vector)

    • Filters default values and null references

    • Adds # + markers for variant modifications

  • Compact mode optimizations (83% token reduction):

    • Short reference syntax (@Player instead of GameObject:Player)

    • Parentheses vector notation: (1, 2, 3) instead of {x:1, y:2, z:3}

    • Field abbreviations: lPos, lRot, lScale, trigger, order, mats

    • Inline simple components: {value: 42, active: true}

    • Omits null/Unknown references entirely

    • Omits enabled:true, default offsets, flipX/flipY:false

    • Removes redundant sortingLayerID (keeps sortingLayer)

    • Converts 0/1 to true/false for boolean fields

    • Converts bitmasks to layer arrays or 'all'

    • Simplifies Unity events to show method names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configNoOptional configuration (uses "standard" preset if omitted)
filePathYesAbsolute path to the .prefab, .unity, or .asset file
Behavior5/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It exhaustively documents output behavior: omitted fields (default values, null references, enabled:true), unity internal field filtering, field renaming to Inspector names, prefab variant handling, and compact mode optimizations. It also details specific examples like 'lPos (0,0,0)' and 'short reference syntax (@Player)'. This is exceptionally transparent.

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 description is long but well-structured with clear sections (WORKFLOW, IMPORTANT, Features, Prefab Variant Support, Compact mode optimizations). It is front-loaded with the core purpose and workflow, and each section adds relevant details. While some information could be trimmed (e.g., extensive compact mode enumeration), it is appropriate for the tool's complexity.

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?

Given the tool's complexity (2 params with nested config, no output schema), the description is remarkably complete. It explains the output structure ('hierarchical structure showing the GameObject tree and all component data'), default value handling, reference resolution, and edge cases like prefab variants. It fully compensates for the lack of an output schema and provides context for all config options.

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 description coverage is 100% for filePath and config properties, so the baseline is 3. The description adds substantial meaning beyond the schema, particularly for the 'preset' parameter by explaining presets (minimal, standard, compact) and detailing compact mode optimizations with token reduction percentages, syntax examples, and abbreviation conventions. This elevates the parameter understanding significantly.

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 clearly states the tool's function: 'Parse a Unity text-serialized prefab, scene, or asset file and extract Inspector-visible component data in YAML format.' The verb 'Parse' and resource 'Unity text-serialized prefab, scene, or asset file' are specific. It distinguishes from siblings like parse_unity_prefab by explicitly covering prefabs, scenes, and assets, implying a broader file parser.

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?

The description provides a clear workflow: 'For best results with asset name resolution, call init_unity_project first. If already initialized, the cache is loaded automatically.' However, it does not explicitly state when to choose this over parse_unity_prefab or other sibling tools, nor does it mention exclusions or alternatives beyond the init prerequisite. This is a gap in usage differentiation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luckynee/unity-prefab-parser-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server