Skip to main content
Glama

script_delete

Remove a C# script from a Unity project by specifying the file path, streamlining script management and project organization.

Instructions

Delete a C# script from Unity project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the script file

Implementation Reference

  • Handler logic for the 'script_delete' tool in UnityMcpTools.executeTool: validates 'path' argument, delegates to adapter.deleteScript, and returns success response.
    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}` }] }; }
  • Tool definition including name, description, and input schema for 'script_delete' returned by UnityMcpTools.getTools().
    { 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'] } },
  • MCP server registration: ListToolsRequestHandler returns the tools list from UnityMcpTools.getTools(), registering 'script_delete'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: this.tools.getTools(), }));
  • MCP server registration: CallToolRequestHandler delegates execution to UnityMcpTools.executeTool for tools including 'script_delete'.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { return this.tools.executeTool(request.params.name, request.params.arguments || {}); });
  • Supporting method in UnityHttpAdapter that sends HTTP request to Unity server endpoint 'script/delete'.
    async deleteScript(path: string): Promise<any> { return this.call('script/delete', { path }); }

Other Tools

Related 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/zabaglione/mcp-server-unity'

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