Class ImportExternalModel
Handles importing assets from outside the Unity project. Creates GameObject in the scene and creates a prefab for reuse.
Inherited Members
Namespace: Unity.AI.MCP.Editor.Tools
Assembly: Unity.AI.MCP.Editor.dll
Syntax
public static class ImportExternalModel
Fields
Description
Human-readable description of the Unity.ImportExternalModel tool functionality and usage.
Declaration
public const string Description = "Import an FBX from a URL in Unity project. Instantiate the model in the scene and saves it as a prefab for reuse.\n\nArgs:\n name: Simple name of the asset, needs to be a single word or id string, no spaces.\n fbx_url: The url to the fbx file to import and instantiate, can be a local file, a url, or a zip file containing an FBX.\n height: Float value that represents the desired height of the asset in the scene.\n albedo_texture_url: The url to the albedo texture file to import and instantiate, can be a local file or a url.\n\nReturns:\n A dictionary with operation results ('success', 'data', 'error').\n The result will include the scene gameobject and the prefab that can be reused to be instantiated.\n Consider the world size and center of the gameObject when instantiating it in the scene.\n When moving the object relative to another one, use the size and center to calculate the appropriate offset based on the bounds of the gameobject."
Field Value
| Type | Description |
|---|---|
| string |
Methods
GetOutputSchema()
Returns the output schema for this tool.
Declaration
[McpOutputSchema("Unity.ImportExternalModel")]
public static object GetOutputSchema()
Returns
| Type | Description |
|---|---|
| object | The output schema object defining the structure of successful responses. |
HandleCommand(ImportExternalModelParams)
Main handler for importing external models.
Declaration
[McpTool("Unity.ImportExternalModel", "Import an FBX from a URL in Unity project. Instantiate the model in the scene and saves it as a prefab for reuse.\n\nArgs:\n name: Simple name of the asset, needs to be a single word or id string, no spaces.\n fbx_url: The url to the fbx file to import and instantiate, can be a local file, a url, or a zip file containing an FBX.\n height: Float value that represents the desired height of the asset in the scene.\n albedo_texture_url: The url to the albedo texture file to import and instantiate, can be a local file or a url.\n\nReturns:\n A dictionary with operation results ('success', 'data', 'error').\n The result will include the scene gameobject and the prefab that can be reused to be instantiated.\n Consider the world size and center of the gameObject when instantiating it in the scene.\n When moving the object relative to another one, use the size and center to calculate the appropriate offset based on the bounds of the gameobject.", null, null, Groups = new string[] { "core", "assets" })]
public static object HandleCommand(ImportExternalModelParams parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ImportExternalModelParams | parameters | Parameters containing model name, FBX URL, height, and optional albedo texture URL. |
Returns
| Type | Description |
|---|---|
| object | A response object with import results including scene object and prefab information. |