script_delete
Remove C# script files from Unity projects to clean up unused code and manage project structure.
Instructions
Delete a C# script from Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the script file |
Implementation Reference
- src/tools/unity-mcp-tools.ts:353-364 (handler)Handler for the 'script_delete' tool. Validates the 'path' argument and calls UnityHttpAdapter.deleteScript(path) to perform the deletion, then returns success message.case 'script_delete': { if (!args.path) { throw new Error('path is required'); } await this.adapter.deleteScript(args.path); return { content: [{ type: 'text', text: `Script deleted successfully: ${args.path}` }] }; }
- src/tools/unity-mcp-tools.ts:99-112 (schema)Schema definition and registration for the 'script_delete' tool, specifying input requirements (path: string).{ name: 'script_delete', description: 'Delete a C# script from Unity project', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the script file' } }, required: ['path'] } },
- Helper method in UnityHttpAdapter that implements script deletion by calling the Unity HTTP endpoint 'script/delete' with the path.async deleteScript(path: string): Promise<any> { return this.call('script/delete', { path }); }