Class CreateScript
Handles creation of new C# scripts at specified project paths.
Inherited Members
Namespace: Unity.AI.MCP.Editor.Tools
Assembly: Unity.AI.MCP.Editor.dll
Syntax
public static class CreateScript
Fields
Description
Human-readable description of the Unity.CreateScript tool functionality and usage.
Declaration
public const string Description = "Create a new C# script at the given project path.\n\nArgs: path (e.g., 'Assets/Scripts/My.cs'), contents (string), script_type, namespace.\nRules: path must be under Assets/. Contents will be Base64-encoded over transport."
Field Value
| Type | Description |
|---|---|
| string |
Methods
GetOutputSchema()
Returns the output schema for this tool.
Declaration
[McpOutputSchema("Unity.CreateScript")]
public static object GetOutputSchema()
Returns
| Type | Description |
|---|---|
| object | The output schema object defining the structure of successful responses. |
HandleCommand(CreateScriptParams)
Main handler for script creation.
Declaration
[McpTool("Unity.CreateScript", "Create a new C# script at the given project path.\n\nArgs: path (e.g., 'Assets/Scripts/My.cs'), contents (string), script_type, namespace.\nRules: path must be under Assets/. Contents will be Base64-encoded over transport.", null, null, Groups = new string[] { "core", "scripting" })]
public static object HandleCommand(CreateScriptParams parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateScriptParams | parameters | Parameters containing the script path, contents, type, and namespace. |
Returns
| Type | Description |
|---|---|
| object | A response object indicating success or failure with relevant details. |